Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
www-test
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Silvia Bindelli
www-test
Commits
6efd4cb1
Commit
6efd4cb1
authored
Jul 15, 2014
by
Riccardo Padovani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated scripts
parent
145c807a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
scripts/backup.sh
scripts/backup.sh
+1
-1
scripts/sql_scrub_dump.sh
scripts/sql_scrub_dump.sh
+10
-1
No files found.
scripts/backup.sh
View file @
6efd4cb1
...
@@ -46,6 +46,6 @@ fi
...
@@ -46,6 +46,6 @@ fi
# Create the backup
# Create the backup
pg_dump
"
$DBNAME
"
>
"
$DIR
"
/today.sql
pg_dump
"
$DBNAME
"
>
"
$DIR
"
/today.sql
tar
-
xc
zf
"
$DIR
"
/today.tar.gz
"
$DIR
"
/today.sql
tar
-
cv
zf
"
$DIR
"
/today.tar.gz
"
$DIR
"
/today.sql
# Remove the temp file
# Remove the temp file
rm
"
$DIR
"
/today.sql
rm
"
$DIR
"
/today.sql
scripts/sql_scrub_dump.sh
View file @
6efd4cb1
...
@@ -35,6 +35,15 @@ dump_output=${2}
...
@@ -35,6 +35,15 @@ dump_output=${2}
dropdb
--if-exists
"
$local_db
"
dropdb
--if-exists
"
$local_db
"
createdb
"
$local_db
"
createdb
"
$local_db
"
# Work in /tmp
cd
/tmp
# If there is yesterday backup, then delete it
if
[
-f
"
$dump_output
"
]
;
then
rm
-f
"
$dump_output
"
fi
# Extract the file and import in psql
# Extract the file and import in psql
tar
-xOvf
"
$dump_input
"
| psql
"
$local_db
"
tar
-xOvf
"
$dump_input
"
| psql
"
$local_db
"
...
@@ -46,5 +55,5 @@ pg_dump "$local_db" > scrubbed-db.sql
...
@@ -46,5 +55,5 @@ pg_dump "$local_db" > scrubbed-db.sql
tar
-cvzf
"
$dump_output
"
scrubbed-db.sql
tar
-cvzf
"
$dump_output
"
scrubbed-db.sql
# Removed temporary files
# Removed temporary files
dropdb
--if-exists
"
$local_db
"
dropdb
"
$local_db
"
rm
-f
scrubbed-db.sql
rm
-f
scrubbed-db.sql
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment