To save those drive eaters, I have two external drives use as redundant storage. The cloud providers save the documents I work on day-to-day while the external drives save files I add but seldom, if ever, change. I try to perform the backup on a monthly basis.
My favorite command for the backup is rsync. As its name implies, it syncs files from one location to another. The nice thing about rsync is that it ignores files that are the same between the source and destination directory. Thus once a file is copied, it isn't copied again. This is a great time saver over a simple cp command.
The base, recommended syntax is
sudo rsync -azvv /home/path/folder1/ /home/path/folder2
This will sync the files from folder1 to folder2, recursing into all sub-directories and compressing the files as it goes. If you add a --delete, the command will delete files in folder2 that no longer exist in folder1.
The sudo is there to make the command run as a root (super) user. This is important as it will resolve any potential permission issues with reading the files.
I use a slightly different version since I'm going to an external drive. I use -avv, choosing not to compress. I also use the --exclude flag for a few directories, like the browser cache, that are temporary in nature. I exclude the .gvfs file as well. If you don't you'll get an annoying error message that is of no importance.
To make the command is correct, use the --dry-run flag which will simulate a run without moving any actual files.
So, my steps for backup are (substitue your own directory names)
- plug in external drive
- open up a terminal window
- cd /home
- sudo rsync --dry-run --exclude=.cache --exclude=.maptool --exclude=.gvfs -avv /home/rkathey/ /media/Athey500/rkathey > t.out
- check the file t.out to make sure everything is there and looks good
- sudo rsync --exclude=.cache --exclude=.maptool --exclude=.gvfs -avv /home/rkathey/ /media/Athey500/rkathey > t2.out
- check t2.out for any problems.
If you want a warm, fuzzy feeling while running step 6, either exclude > t2.out from the command above or tail -f t2.out from another command window. I prefer the tail -f command so I have a history of what was transferred.
Note that if you shy away from the command line, you can also install Grsync from the Ubuntu software center for a graphical interface. The interface looks pretty simple and it claims to simply wrap the standard rsync command with a gui. Note: I have actually tried this program.
It's no coincidence that pictures are one of the few items that people decide to save before anything else during a disaster. In today's digital age, most photos and other important information resides on our computers. Having a good backup plan is like insurance - it brings peace of mind even if you hope you never need it.
Happy Backuping,
Zack's Dad
p.s. Merry Christmas
No comments:
Post a Comment