LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   HELP! Rsync deleted the source files! (http://www.linuxquestions.org/questions/linux-software-2/help-rsync-deleted-the-source-files-653737/)

tpe 07-05-2008 09:57 AM

HELP! Rsync deleted the source files!
 
Hi,
I have a major issue with rsync. Preface:
2 servers, with Centos 5-x86_64.
host files:
Code:

192.168.0.1 server1.mycompany.com
192.168.0.2 server2.mycompany.com

root can login from server1 to server2 via passwordless ssh and vice versa.

/home on server1 is full of data (100GB).
/home on server2 was empty.

I used rsync to initially copy them to server2, with the following options: -avz --delete
The complete command was:
/usr/bin/rsync -avz --delete /home/ root@server2:/home

The only other difference between the 2 servers was the timestamp (server 2 was late by 5 minutes).

The result was the data loss on server1. Nothing copied on server2! WHY?

Thank you

Tinkster 07-05-2008 09:09 PM

Sorry, but I very much doubt that the problem is with rsync.

There's either user-error (kicked it off on the wrong machine?)
or maybe a faulty DNS (or /etc/hosts) set-up (which of course again
is user error).

That all said: if you don't have a recent back-up, or a file-system
like ext2 which allows for reasonably easy recovery, there's not
much you can do in this situation.




Cheers,
Tink

trickykid 07-05-2008 10:13 PM

Never use the --delete unless you are absolutely sure. And from the looks of it, you're trying to mirror server 1 to server 2. There's really no reason to delete the source files. The only time I use --delete is if I'm doing it with some backup type script, not the original files but already backed up files, etc.

Tinkster 07-05-2008 11:49 PM

Actually rsyncs delete NEVER operates on the sending
machines side, always on the receiving. It doesn't even have
an option to be deleting stuff of the sender.


Cheers,
Tink

tpe 07-06-2008 02:01 AM

Quote:

Originally Posted by Tinkster (Post 3205278)
Actually rsyncs delete NEVER operates on the sending
machines side, always on the receiving. It doesn't even have
an option to be deleting stuff of the sender.


Cheers,
Tink

I know! That's why I cannot understand why that happed! I suspect that the script failed to find server2, somehow, but I cannot understand why it deleted the source. Strange. Anyway, the backup is not an option (it's quite old, because it had failed all previous days). Undelete is not possible (ext2, on LVM!).
Too bad. Anyway, thanks for the reassurance that the deletion was not done by rsync.


All times are GMT -5. The time now is 04:05 AM.