Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

'rsync is a capable alternative'

except for the fact that rsync has a very weird (to me) behavior with regards to trailing slashes in copying directories.

most definitely not a drop-in replacement for scp



argh trailing slashes can be a pain! I've had to delete/move many times due to differences in trailing slashes.


You are right, but the rsync behavior has good reasons, explained in its man page.

Moreover, all UNIX commands have different behavior depending on whether you write or not trailing slashes, at least when the arguments happen to be symbolic links.

To avoid mistakes due to the different behaviors, I use for cp and mv aliases that include the option "--strip-trailing-slashes".


That's a problem with scp, not with rsync.

  rsync dir_a server:dir_b
Will there be a directory called dir_a on the server? Well, that depends on if dir_b exists. Run the command again and the result may be different. That's not acceptable behaviour for a tool keep a remote directory synced.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: