![]() This is a sweet way to get incremental backups without having to restore from multiple locations.įor more details, see Time Machine for every Unix out there, the page I based this on. You can delete an older backup directory without fear-the hard links mean newer backups aren’t affected. Using rsync with –link-dest means that only files which have changed since the previous backup take up space on the disk, even though in each timestamped directory is a complete live version of the directory as it existed at the time of the backup. Since mysqldump adds a timestamp to the end of the dump, I have to compare all but the last line, which is what head -n -1 does. ![]() The first bunch just deals with making db backups and sticking them in a directory under /sites so they’ll get backed up too, but only create a new file if they’ve changed. Rsync -a -link-dest='/mnt/backup/current' -exclude '*/logs/*' /sites/ /mnt/backup/sites-$date Issue the command ssh-copy-id -i /.ssh/idrsa.pub USERNAMEREMOTEHOSTIP ( USERNAME is the name of the user on the remote host, and REMOTEHOSTIP. Mysqldump -user=root -password= -opt $db > $.tmp | md5sum | cut -f 1 -d ' '` Find /var/lib/mysql -maxdepth 1 -mindepth 1 -type d | grep -v 'lost+found' | while read i do
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |