Re: Backups
Reply #28 –
Actually... scrap what I said, I use http://www.webupd8.org/2014/09/gdrive-simple-google-drive-cli-client.html
Basically I have an sh script that looks something like:
now=$(date +"%Y_%m_%d")
file_name="elkarte_$now"
full_path="/safe/path/$file_name"
mysqldump -u root --password=mypwd mydb > "$full_path.mydump.sql"
zip -q -r "$full_path.dump.zip" "$full_path.mydump.sql"
/usr/local/bin/drive upload -f "$full_path.dump.zip" -t "$file_name.dump.zip" -p secret_token
rm -f "$full_path.mydump.sql"
rm -f "$full_path.dump.zip"
zip -q -P apwd -r "$full_path.forum.files.zip" /path/to/root/htdocs/forum/ -x "*/packages/*"
/usr/local/bin/drive upload -f "$full_path.forum.files.zip" -t "$file_name.forum.files.zip" -p secret_token
rm -f "$full_path.forum.files.zip"
DATE=$(date +%y-%m-%d)
/usr/sbin/sendmail myemail@gmail.com <<EOF
subject: Daily backup - $DATE
Saved files:
* $file_name.dump.sql
* $file_name.forum.files.zip
EOF
There are some variables playing around to set