Just sharing a gotcha with "rsync" that caused me big trouble ...
what's nasty about rsync ? .. .. which may cause devastating consequences. rsync is in my opion the best thing since sliced bread... but be careful. CLI commands -- cp, rcp, scp, rsync, all have similarites BUT there are some nasty gotcha's when switching from one to another. You probably noticed some oddities , but had worked around it. (with the help of an error message) Without an error message you may had come to grief. Consider .............. Scenario: For whatever reason -- you want to restore the /etc directory from a local backup. Lets just use a simple example.. "cp" should handle this. "rsync" should also should handle this. But "cp" is your friend if you make an error ... "rsync" is not. OK .... There is NO source or destinantion directory "ets" but you make a typo "ets" instead of "etc" "cp" will give you an error message whereas "rsync" will do what is not intended and you will be *unaware* So the following commands [r...@localhost ~]# cp -a /backup/etc/* /ets [r...@localhost ~]# rsync -a /backup/etc/* /ets "cp" will error out telling you that the target is not a directory whereas "rsync will SILENTLY create the dir (ets) and populate it. So if you didn't check the result .... disaster beckons. Note that the creation of directories occur without a trailing slash on the source. But in that instance directory created is the name of the source directory. I have found some other gotchas ...... But do be aware of this (nasty) feature. Won't go into detail .... but some are ......... Like the deal with the trailing slash ..... which can cause issues --- (often put there by bashs tab completion). I like putting a "*" after a trailing slash as i find it more intuitive. Also ........ creating a new dir once -- but not twice.. Blah..Blah Cheers Roger -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
