Tag Archive for 'rsync'

Backup and Restore In Ubuntu

So I finally got around to installing 6.10 on Management’s laptop and it was a dream now that I finally took the time to hammer out backup and restore scripts (Ted Ruegsegger has a great write up that I cribbed from to do this). Now, some people might be asking, “Why not just do an in place upgrade?” Good question, and my answer is cruft.

One of the things that I have noticed is that in place upgrades greatly increase the amount of depreciated config files and general cruft with the system and while performing one is pretty damn convenient it takes just about the same amount of time as installing the latest version, particularly since I go through the process of backing up the user directories.

Here’s the backup script I run:

cd /home
rsync -e ssh -av –delete –delete-excluded \
–exclude “tmp” \
–exclude “[cC]ache” \
–exclude “.Trash” \
me me@my.SSH-server.name:/home/me/backups

It would be nice to add this script to my Cron jobs but since this is a laptop I made a menu item so it can be run whenever I remember. Also, I have it run in a terminal and added the verbose switch so I can have the warm and fuzzies of a visual indication that something is happening.

To restore files, it is as simple as running the backup in reverse from /home:

rsync -e ssh -av me@my.SSH-server.name:/home/me/backups/me .

With Management’s laptop, I ran the restore right after I logged in and setup SSH with a pre-shared key. The catch was after the restore was done I needed to log out and back in for all the settings to work (killall gnome-panel just sort of made things wonky). All in all, the upgrade took about 2 hours from start to finish with no hiccups.





Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States