Skip to content

Instantly share code, notes, and snippets.

@maracuja
Created September 8, 2014 08:26
Show Gist options
  • Save maracuja/d419b3f3156674c40c4d to your computer and use it in GitHub Desktop.
Save maracuja/d419b3f3156674c40c4d to your computer and use it in GitHub Desktop.
timestamped db backup command for postgres in crontab
0 5,13 * * * pg_dump dbname_dev --no-owner > /var/lib/postgresql/backups/dev-`date +\%Y-\%m-\%d_\%T`.sql
0 5,13 * * * pg_dump dbname_uat --no-owner > /var/lib/postgresql/backups/uat-`date +\%Y-\%m-\%d_\%T`.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment