Skip to content

Commit c3a5f50

Browse files
author
matthias_schaub
committed
Backup to dir with timestamp
1 parent 21b2476 commit c3a5f50

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

postgres/scripts/backup.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ PGPASSWORD="backupuserpassword"
99
ssh -Cfo ExitOnForwardFailure=yes -NL 1111:localhost:5432 ${SSH_REMOTE_HOST}
1010
PID=$(pgrep -f 'NL 1111:')
1111

12+
mkdir $(date +%Y%m%d) && cd "$_"
13+
1214
PGPASSWORD=$PGPASSWORD pg_dump \
1315
--dbname=$PGDATABASE \
1416
--username $PGUSER \

0 commit comments

Comments
 (0)