Test rsync with dry runs before executing to avoid losing data

Posted in apps , howto , storage

rsync

With the power of rsync, it’s quite easy to accidentally erase, overwrite, or otherwise destroy your data with one slip of the keys.

Before you even think of attempting anything complicated like deleting extraneous files on the destination, handling file systems that don’t support permissions such as FAT32 with -lrt, do a dry run barrel roll.

dry run

If you’re doing something other than non-trivial copies or using features of rsync that you’ve never used before, add the -n switch to whatever you’re doing to make it a dry run.

rsync -avhn /orig/src /home/user/dest/
rsync -nbrvvhn --del --bwlimit=1000 /orig/src/ /home/user/dest/
rsync -rn --size-only --exclude=*.iso /orig/src/ /home/user/dest/

Even if you supply the right switches, you might leave off a slash or put one where it doesn’t belong. Better safe than sorry, especially when you’re about to churn through terabytes of data at a time.

building file list ... done
deleting file_1
deleting file_2
deleting file_3
...
deleting file_79292
deleting file_79293
deleting file_79294
./
Number of files: 1
Number of files transferred: 0
Total file size: 0 bytes
Total transferred file size: 0 bytes
Literal data: 0 bytes
Matched data: 0 bytes
File list size: 28
File list generation time: 0.001 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 44
Total bytes received: 20

sent 44 bytes  received 20 bytes  128.00 bytes/sec
total size is 0  speedup is 0.00

oops…

Posted by admica   @   28 July 2010
Tags : , , ,

Related Posts

Like this post? Share it!

Digg Twitter StumbleUpon Delicious Technorati Facebook RSS

0 Comments

No comments yet. Be the first to leave a comment !
Leave a Comment

Name

Email

Website

Previous Post
« How to restore hidden toolbar in Firefox
Next Post
Can you detect an ATM skimmer? »
Powered by Wordpress   |   Lunated designed by ZenVerse