Quote:
Originally Posted by Boofo
Chris, can you PM exactly what you use for the file backups? I'm not sure I understand it fully.
@ Lynne - Thanks for the reminder on the file backups. Great idea! 
|
I actually wrote it all up once. Here's the filesystem howto:
https://vborg.vbsupport.ru/showthread.php?t=105728
It's the same thing for the DB. In /etc/cron.daily I have a script called backup.sh, that contains this:
Code:
# Sevenstring.org Backup
mysqldump --opt -Q -u username -ppassword dbname > /path/to/your/backups/sevenstring-`date --iso-8601`.sql
Sleep 5
# Client 1 Backup
mysqldump --opt -Q -u username -ppassword dbname > /path/to/your/backups/client1-`date --iso-8601`.sql
sleep 5
# Client 2 Backup
mysqldump --opt -Q -u username -ppassword dbname > /path/to/your/backups/
And in /etc/cron.weekly, another file called weekly.sh that contains that, with the filesystem tacked on the end, like this:
Code:
#! /bin/bash
# Compressed Directory Tree Backup
tar -czvf /your/backup/folder/sitedata-`date --iso-8601`.tar.gz /path/to/your/siteroot/httpdocs/
# Sevenstring.org Backup
mysqldump --opt -Q -u username -ppassword dbname > /path/to/your/backups/sevenstring-`date --iso-8601`.sql
Sleep 5
# Client 1 Backup
mysqldump --opt -Q -u username -ppassword dbname > /path/to/your/backups/client1-`date --iso-8601`.sql
sleep 5
# Client 2 Backup
mysqldump --opt -Q -u username -ppassword dbname > /path/to/your/backups/
The format for the output file is just the linux date call, so this:
sitedata-`date --iso-8601`.tar.gz
Makes a file called sitedata-2008-02-24.tar.gz. In the same vein, the dtabase backups are named things like sevenstring-2008-02-24.sql, etc, etc, so that the filenames ARE the dates they are created.

You can change 'sitedata' to whatever you want to call it.
Short version: Make textfile. Stick commands in, copy it to /etc/cron.daily (or weekly/monthly). So when I am about to install a plugin, I just run the script manually:
sh /etc/cron.weekly/backup.sh
And it does a backup stamped with today's date that I can restore from if and when I screw something up.