Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rsync --delete not working as expected

Status
Not open for further replies.

kapplersvictory

Programmer
Mar 17, 2003
15
ZA
I am trying to create a backup/failsafe strategy between two servers

One is currently running mail services and another is running file server.

At the end of each day I want the mail server to synchronize the mailboxes to the file server and the file server to synchronize user's homes on the mailserver.

rsync -vrae 'ssh -p2222' --delete mailserver:/var/spool/mail fileserver:/var/spool/mail

The command above works perfectly and deletes/replace old or emptied mailboxes files if necessary.


I have succesfully mirrored users on both servers, following a recent post on this forum.

Now I want to run a similar command to synchronize home directories.

rsync -vrae 'ssh -p2222' --delete fileserver:/home/ mailserver:/home

For some strange reason the above command seems to copy all home's files again each time, taking forever obviously, and on top of it, it doesn't delete files that don't exist anymore on the source server.

Any idea why this would happen?

KV



I had a cool footer but the webmaster told me to remove it! America is the land of freedom...
 
I think its because of the extra / after home in fileserver:/home/

--== Anything can go wrong. It's just a matter of how far wrong it will go till people think its right. ==--
 
Are you sure?

Will try and get back to you.

Thanks

KV

I had a cool footer but the webmaster told me to remove it! America is the land of freedom...
 
Hi Zeland,
Your suggestion didn's make any difference.
but here is what I found out.
If I try rsync the whole /home directory it will build the file list and then start copying across each file again.

If I instead do the same on subdirectories with not many files, it will sork correctly.

It seems to have problems on large number of files; does it make any sense?

KV


I had a cool footer but the webmaster told me to remove it! America is the land of freedom...
 
Sorry on the bad call earlier. When you go 2 night without sleep, you tend to muddle things up. I was trying to get you to test syncing the the whole /home folder instead of the individual files/folder inside it: rsync -vrae 'ssh -p2222' --delete fileserver:/home mailserver:/

My problem a while back was syncing a 100GB++ /home folder on our SAMBA DC to a remote backup server that had a tape drive. Somehow, if I synced only the files in /home, rsync would quietly fail without error. However, if I synced the whole /home folder, everything works. I supposed is much like doing rm -rf * in a folder with 30000+ files and getting an error /bin/rm: Argument list too long. But if you rm -rf [folder], everything just works.

--== Anything can go wrong. It's just a matter of how far wrong it will go till people think its right. ==--
 
hi Zeland,


I solved it in the meantime, doing this

rsync -vrae 'ssh -p2222' --delete fileserver:/home/* mailserver:/home

Why would it work if I put * after the fileserver's home?

KV
 
Sorry, I partially solved it,

it doesn't copy all files again, and that's good, but still doesn't delete from the mailserver files that don't exist anymore on the fileserver.

KV


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top