Since you say "mv doesnt' work like that", I assume you're
moving
directories from one filesystem to another.
rsync acts sort of like cp, or the cp part of a mv across filesystem
boundaries, in that it goes item by item. Unlike mv and cp, it doesn't
write the incoming file to its eventual name until it's successfully
present (or at least until the transfer stops with --partial), but if it
gets 2 of 8 items copied over and dies, it doesn't undo the transfer.
What you really need is a sort of a custom wrapper for rsync, or cp, or
mv, or whatever you choose, that does the copy, shadowing anything
overwritten to a temporary backup, then, if the transfer succeeds, remove
the source files, else, remove everything sent over, and move back the
shadowed items. If you're always sending things that don't already
exist
on the destination, you can leave out the shadowing... your call.
Tim Conway
Unix System Administration
Contractor - IBM Global Services
conway@us.ibm.com
I need to move files from one directory to another directory
remotely. I can issue an 'mv' command through SSH but I want
something that will move all the files that i tell it to
move or none, and 'mv' doesnt work like that. Is it possible
to use Rsync to do this? I was hoping to invoke rsync from
machine A on machine B to machine B. Is this possible ? If
you can suggest any other tools or ideas please let me know.