Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
camino
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
pnm-public
camino
Commits
3b2a07f4
Unverified
Commit
3b2a07f4
authored
10 months ago
by
vmaubert
Committed by
GitHub
10 months ago
Browse files
Options
Downloads
Patches
Plain Diff
chore(backup): ajoute une commande pour récupérer un backup sans les fichiers (#1234)
parent
688f0c79
Loading
Loading
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.dockerignore
+2
-1
2 additions, 1 deletion
.dockerignore
infra/roles/prod/templates/backup
+1
-1
1 addition, 1 deletion
infra/roles/prod/templates/backup
packages/api/.gitignore
+1
-0
1 addition, 0 deletions
packages/api/.gitignore
packages/api/package.json
+2
-2
2 additions, 2 deletions
packages/api/package.json
with
6 additions
and
4 deletions
.dockerignore
+
2
−
1
View file @
3b2a07f4
...
...
@@ -12,6 +12,7 @@ infra/cd/.cargo_docker
infra/cd/.cargo
infra/cd/target
packages/api/backups
packages/api/backup_without_files.backup
packages/api/sources
packages/api/files
packages/api/api-cache
...
...
@@ -20,4 +21,4 @@ packages/api/docs
packages/ui/coverage
packages/ui/stats.html
packages/ui/dist
docs
\ No newline at end of file
docs
This diff is collapsed.
Click to expand it.
infra/roles/prod/templates/backup
+
1
−
1
View file @
3b2a07f4
...
...
@@ -16,7 +16,7 @@ docker exec camino_api_db vacuumlo camino
docker
exec
camino_api_db pg_dump
--clean
--if-exists
--format
=
d
--no-owner
--no-privileges
--dbname
=
camino
-f
/dump
docker
exec
camino_api_db
chown
-R
"{{camino_user_uid}}:
${
USER_GROUP_ID
}
"
/dump
docker
exec
camino_api_db pg_dump
--clean
--if-exists
--no-owner
--no-privileges
-B
--dbname
=
camino
>
/srv/backups/dump_without_files.
sql
docker
exec
camino_api_db pg_dump
--clean
--if-exists
--no-owner
--no-privileges
-B
--dbname
=
camino
--format
c
>
/srv/backups/dump_without_files.
backup
# sauvegarde les fichiers
rsync
--delete
-r
/srv/www/camino/files/ /srv/backups/files
...
...
This diff is collapsed.
Click to expand it.
packages/api/.gitignore
+
1
−
0
View file @
3b2a07f4
...
...
@@ -8,6 +8,7 @@
node_modules
/backups
backup_without_files.sql
backup_without_files.backup
/dist
/coverage
/api-cache
...
...
This diff is collapsed.
Click to expand it.
packages/api/package.json
+
2
−
2
View file @
3b2a07f4
...
...
@@ -11,9 +11,9 @@
"monthly"
:
"node --loader ts-node/esm/transpile-only ./src/scripts/monthly.ts"
,
"db:dump"
:
"rm -rf ./backups/* && pg_dump --host=localhost --username=postgres --clean --if-exists --format=d --no-owner --no-privileges --dbname=camino --file=./backups/"
,
"db:import"
:
"pg_restore --host=localhost --username=postgres --clean --if-exists --no-owner --no-privileges --dbname=camino ./backups"
,
"db:import-without-files"
:
"pg_restore --host=localhost --username=postgres --clean --if-exists --no-owner --no-privileges --dbname=camino ./backup_without_files.
sql
"
,
"db:import-without-files"
:
"pg_restore --host=localhost --username=postgres --clean --if-exists --no-owner --no-privileges --dbname=camino
<
./backup_without_files.
backup
"
,
"db:prod-fetch"
:
"rm -rf ./backups/* && ssh camino.beta.gouv.fr 'rm -f ~/backup.tgz && cd /srv/backups/dump/ && tar cvzf ~/backup.tgz .' && scp camino.beta.gouv.fr:~/backup.tgz backups/ && tar xvf backups/backup.tgz --directory ./backups"
,
"db:prod-fetch-without-files"
:
"scp camino.beta.gouv.fr:/srv/backups/dump_without_files.
sql
./backup_without_files.
sql
"
,
"db:prod-fetch-without-files"
:
"scp camino.beta.gouv.fr:/srv/backups/dump_without_files.
backup
./backup_without_files.
backup
"
,
"db:recreate"
:
"dropdb --host=localhost --username=postgres camino && createdb --host=localhost --username=postgres camino"
,
"db:migrate"
:
"node --loader ts-node/esm/transpile-only ./src/knex/migrate.ts"
,
"db:add-migration"
:
"NODE_OPTIONS='--loader ts-node/esm/transpile-only' knex migrate:make"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment