Skip to content

Instantly share code, notes, and snippets.

@xuyuji9000
Last active August 11, 2017 08:14
Show Gist options
  • Save xuyuji9000/0481060c62d3643c9a6466ce21b02859 to your computer and use it in GitHub Desktop.
Save xuyuji9000/0481060c62d3643c9a6466ce21b02859 to your computer and use it in GitHub Desktop.
Make a full backup of a specific database in mysql
#!/bin/bash
DATABASE="forward"
mysqldump -u mysqlusernamehere -pmysqlpasswordhere $DATABASE > /mnt/mysql/full/$(date +"%d-%b-%Y")_$(echo $DATABASE).sql
@xuyuji9000
Copy link
Author

xuyuji9000 commented Aug 11, 2017

crontab cheetsheet

alt text

0 0 * * 0 /root/mydatabasebackupscript.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment