Skip to content

Commit cc4ff4d

Browse files
committed
Add minimal local backup/restore scripts
Signed-off-by: Philippe Ombredanne <[email protected]>
1 parent 6d379d0 commit cc4ff4d

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

etc/scripts/backup.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
# backup current Db
3+
4+
DBDUMP=vcio-db-dump-$(date +"%Y-%m-%d_%H%M").dump
5+
echo "Backup vulnerablecode current DB to: $DBDUMP"
6+
sudo -u postgres pg_dump --format=c vulnerablecode > $DBDUMP

etc/scripts/restore.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
# backup current Db and then restore a dump
3+
4+
./backup.sh
5+
echo "Restore vulnerablecode dump from: $1"
6+
sudo -u postgres dropdb vulnerablecode
7+
sudo -u postgres createdb --encoding=utf-8 --owner=vulnerablecode vulnerablecode
8+
sudo -u postgres pg_restore --verbose -d vulnerablecode $1
9+

0 commit comments

Comments
 (0)