Created
November 4, 2015 13:54
-
-
Save rodolfobarretoweb/c20fd5f13d6b9bfb4bc4 to your computer and use it in GitHub Desktop.
Backup mysql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# script.sh | |
# Print the date | |
DATE=`/bin/date +%d-%m-%Y` | |
NANE="/your/path/$DATA.sql" | |
HOST="" | |
USER="" | |
PASSWORD="" | |
DATABASE="" | |
mysqldump -h $HOST -u $USER -p$PASSWORD $DATABASE > $NAME | |
# Link to install dropbox on ubuntu server | |
# https://www.dropbox.com/install?os=lnx | |
cp $NAME /your/path/Dropbox/your-path-backup-in-dropbox/$DATE.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
VISUAL=vi crontab -e
0 2 * * * /bin/sh /home/user/your-path-to-backup/script.sh