Skip to content

Instantly share code, notes, and snippets.

@EvilScott
Created March 8, 2017 22:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EvilScott/694e72f83e80d938d342d06b71ce41b4 to your computer and use it in GitHub Desktop.
Save EvilScott/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