2013/11/23

rsync - best tool ever

For crying out loud, I never added a note about rsync?! Probably the one note I should have had that I would have guessed would have led me to starting this whole blog. Maybe I just forgot how to search through my old posts…

rsync -avzr --progress “Star Trek” kinjileslie@192.168.1.110:~/Desktop/ 

Copies all of the Star Trek! to the remote computer’s desktop. Please be careful with the trailing slash on file names with rsync… If “Star Trek/“ is specified, that would copy all of the items in the folder to the destination, not the folder itself. I believe if in the above command “~/Desktop” is set as the destination, we might be telling rsync to copy over that folder instead of into it. That could be disastrous.

Regardless, it never hurts to be overly specific, especially when executing batch file operations on the command line. 

Were I playing with servers and remote computers a lot these days, I’d spend the two minutes it would take to experiment and find out. Since I don’t really do this kind of thing anymore… I’m sure I’d just forget again anyway. 

Options used above: a for archive, v for verbose (feel free to add more vs, I think you get more output maybe), z for compression, and r for recursive. The progress option is my favorite feature of rsync (besides being able to resume copies after they time out or get interrupted—I take it back, that’s my favorite option). 

With the progress option, I can easily see which file (episode of Star Trek!) rsync is currently working on, current transfer rate, estimated time remaining for the file, and how long it took previous files to copy over.

Now, there are all sorts of more useful things one can do with this command, like syncing folders and merging files and other wizardry I'm sure I have no idea what I'm talking about. See the delete and links options.