Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
Nuovo sito - PHP
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
37
Issues
37
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gruppo Web
Nuovo sito - PHP
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
Hide 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
# Create the backup
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
rm
"
$DIR
"
/today.sql
scripts/sql_scrub_dump.sh
View file @
6efd4cb1
...
...
@@ -35,6 +35,15 @@ dump_output=${2}
dropdb
--if-exists
"
$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
tar
-xOvf
"
$dump_input
"
| psql
"
$local_db
"
...
...
@@ -46,5 +55,5 @@ pg_dump "$local_db" > scrubbed-db.sql
tar
-cvzf
"
$dump_output
"
scrubbed-db.sql
# Removed temporary files
dropdb
--if-exists
"
$local_db
"
dropdb
"
$local_db
"
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