Skip to content

Instantly share code, notes, and snippets.

@kurtisdunn
Last active June 1, 2019 02:56
Show Gist options
  • Save kurtisdunn/9ec5ab2517fd07bf4a06fa5fa1e1b86f to your computer and use it in GitHub Desktop.
Save kurtisdunn/9ec5ab2517fd07bf4a06fa5fa1e1b86f to your computer and use it in GitHub Desktop.
Backup Remote MySQL CRONTAB(5)

Backup Remote MySQL CRONTAB(5)

Once an hour on the hour.

DATEVAR=date +%Y%m%d_%H%M%S
0 * * * * /usr/local/bin/mysqldump -u <USER> --password="<PASSWORD>" -h remote.host.com -P <PORT> db > /PATH/TO/BACKUP/db_$($DATEVAR).sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment