Question about Backups
7 Replies
Technically, the disk image backups themselves are file based, so you need to stick with a supported filesystem (e.g., create the image via the Linode Manager) or else the backup system won't be able to function.
Essentially it supports a "bare metal" (or bare VPS) restoration (and in fact does not support per-file restorations). If you were to create a new Linode, restore a backup, and then boot the configuration profile, your Linode would be back to the same complete state it was in as of the backup.
When you restore, the restoration configurations/images are all given a prefix of "Restore ####" so you can restore to an existing Linode as long as you have space, and then make any adjustments you may wish. The disk images will be only slightly larger than needed for their files, so not their exact original size, but you can expand them afterwards. That also helps with a restoration potentially fitting on a Linode that already has a configuration.
– David
here's my script to do that, cron runs it every morning
#!/bin/bash
for a in `seq 8 -1 0`; do
mv /var/backups/mysql/mysqldump.sql.$a.bz2 /var/backups/mysql/mysqldump.sql.$[a+1].bz2
done
/usr/bin/mysqldump --events --all-databases > /var/backups/mysql/mysqldump.sql.0
/bin/bzip2 -9 /var/backups/mysql/mysqldump.sql.0
that will keep about 10 copies of your database on disk, so if it's a large database, it might not fit. you can change seq 8 -1 0 to (eg) seq 3 -1 0 to keep about 4 copies.
@chesty:
#!/bin/bash for a in `seq 8 -1 0`; do mv /var/backups/mysql/mysqldump.sql.$a.bz2 /var/backups/mysql/mysqldump.sql.$[a+1].bz2 done
FWIW, in bash you can replace most uses of 'seq' with brace expansion
for a in {8..0}; do
Also note the square bracket syntax for arithmetic expansion is deprecated