Skip to content

Instantly share code, notes, and snippets.

@MollsReis
Created March 8, 2017 22:17
Show Gist options
  • Save MollsReis/694e72f83e80d938d342d06b71ce41b4 to your computer and use it in GitHub Desktop.
Save MollsReis/694e72f83e80d938d342d06b71ce41b4 to your computer and use it in GitHub Desktop.
PostgreSQL automated dumps (and cleanup)
# m h dom mon dow command
0 0 * * * pg_dump DATABASENAME > $(date "+%b_%d_%Y").bak
0 1 * * * find ~/*.bak -mtime +10 -type f -delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment