apisub_backup.sh 248 Bytes
Newer Older
Stephane Crozat's avatar
Stephane Crozat committed
1 2
#!/bin/bash
# Execute as postgres user
Stephane Crozat's avatar
Stephane Crozat committed
3
# crontab -e : 0 * * * * /usr/bin/apisub_backup.sh
Stephane Crozat's avatar
Stephane Crozat committed
4 5 6 7 8 9
path='/home/apisub/backup'
date=`date -Iminutes`
echo "$date"
file="$path/apisub_$date.dump"
echo "Backuping apisub to $file"
pg_dump -cC --file $file apisub