LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 07-05-2008, 09:57 AM   #1
tpe
Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Suse Linux
Posts: 98

Rep: Reputation: 16
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
 
Old 07-05-2008, 09:09 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,950
Blog Entries: 11

Rep: Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860
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
 
Old 07-05-2008, 10:13 PM   #3
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 194Reputation: 194
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.
 
Old 07-05-2008, 11:49 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,950
Blog Entries: 11

Rep: Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860
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
 
Old 07-06-2008, 02:01 AM   #5
tpe
Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Suse Linux
Posts: 98

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by Tinkster View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[rsync] get the differences between the source files and the existing files djgerbavore Linux - Networking 2 06-04-2008 12:05 PM
network backups with rsync, keep deleted files somewhere else? Telexen Linux - Server 1 09-06-2007 01:24 PM
Umlaut-Folder cannot be renamed or deleted (rsync) linusneumann Linux - Software 3 06-19-2007 10:41 AM
make rsync output deleted files? hawarden Linux - Software 8 03-18-2005 12:24 PM
How to delete the destination files while the source files deleted in cp -u ? myunicom Linux - General 4 09-26-2003 01:13 PM


All times are GMT -5. The time now is 12:50 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration