Why rsync deletes source directory?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Why rsync deletes source directory?
# 1  
Old 01-04-2010
Why rsync deletes source directory?

Hi

I have a strange problem. Sometimes when I execute the below command something wierd happens.

rsync -avz -e ssh travegre@travegre.net: ../travegre.net/

the folder named "hm" that is held in travegre.net and is coppied along with all the other folders and data at travegre.net, gets deleted or better yet, the name of the folder is still there but is changed to "hm@" as a link which points to nothing. When I looked at the output of rsync the last time this happened (it doesn't happen on every run of rsync but has happened many times now) I found this strange:
Code:
rsync: delete_file: rmdir "/home/travegre.net/hm" failed: Directory not empty (39)

"/home/travegre.net/" is the directory to which I copy files, so I don't understand why rsync would want to delete it at any point, moreover, why delete only the directory "hm" and above all, why all this problems always just with this directory, as if it was special in some way? But in the end, as I said, the directory in the destination is intact and the one in the source server gets ruined.

This problem has been bugging me for long time and I didn't find any answer on the web so if someone has any idea or a hint as to solution to this problem I would be very grateful, also tell me if I have to post this question somewhere else as I'm quite new here.

Thanks in advance

Gregor Traven

Last edited by Yogesh Sawant; 12-10-2010 at 05:31 AM.. Reason: added code tags
# 2  
Old 01-04-2010
Double post, thread closed. Continued here
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Rsync Error: rsync: link_stat failed: No such file or directory (2)

I wish to copy all the files & folder under /web/Transfer_Files/data/ on mymac1 (Linux) to remote server mybank.intra.com (Solaris 10) /tmp/ location I am using Ansible tool synchronize module which triggers the unix rsync command as below:rsync --delay-updates -F --compress --archive --rsh=ssh... (2 Replies)
Discussion started by: mohtashims
2 Replies

2. UNIX for Beginners Questions & Answers

Move directory with rsync and delete from source

I need a rsync command which will exclude certain files and directories from source and copy the rest. I got this command working, sudo rsync -avzh --exclude 'bin' --exclude 'braintree' --exclude 'colinmollenhour' --exclude 'composer' --exclude 'doctrine' --exclude 'fabpot' --exclude... (2 Replies)
Discussion started by: Siddheshk
2 Replies

3. UNIX for Dummies Questions & Answers

How to move gz files from one source directory to destination directory?

Hi All, Daily i am doing the house keeping in one of my server and manually moving the files which were older than 90 days and moving to destination folder. using the find command . Could you please assist me how to put the automation using the shell script . ... (11 Replies)
Discussion started by: venkat918
11 Replies

4. UNIX for Advanced & Expert Users

Rsync error while running from destination to source

hi All, i have 2 server setup now for Rsync, i configured Rsync on both of the server and it worked well when i did run from source to destination. and while running back from destination to source it produced this error: bash-3.2$ ksh rsync_bravo_db.ksh usa0300uz1247.apps.mc.xerox.com... (0 Replies)
Discussion started by: lovelysethii
0 Replies

5. Solaris

rm -rf not able deletes file but not the directory

i am trying to remove a directory using rm -rf command but its not getting removed.. it doesnt throw any error also.. i am logging as the owner of the dir and removing it but still no luck.. i am able remove a file but not a directory. i am using solaris 10 (12 Replies)
Discussion started by: chidori
12 Replies

6. Linux

Modifying Rsync script to check source

Hi I am running rsyncs between a raid attached server and a nas device, which works fine. I am using the --delete to ensure that its kept in sync. And running a log at the end of the sync for me to check. this i am running from a cron Problem is if the part of the raid fails on the server the... (1 Reply)
Discussion started by: treds
1 Replies

7. UNIX for Advanced & Expert Users

How to rsync or tar directory trees, with hidden directory, but without files?

I want to backup all the directory tress, including hidden directories, without copying any files. find . -type d gives the perfect list. When I tried tar, it won't work for me because it tars all the files. find . -type d | xargs tar -cvf a.tar So i tried rsync. On my own test box, the... (4 Replies)
Discussion started by: fld2007
4 Replies

8. UNIX for Dummies Questions & Answers

Deletes those files in a directory ?

I need a shell script that accepts 2 directories names bar1 and bar2 as arguments , and deletes those files in bar2 which are are identical to their name spaces in bar1. I tried with this code but it gives error. if then echo " syntax <comnd dir1 dir2 > " exit else ... (6 Replies)
Discussion started by: krishnampkkm
6 Replies

9. UNIX for Advanced & Expert Users

rsync deletes original directory

Hi I have a strange problem. Sometimes when I execute the below command something wierd happens. rsync -avz -e ssh travegre@travegre.net: ../travegre.net/ the folder named "hm" that is held in travegre.net and is coppied along with all the other folders and data at travegre.net, gets deleted... (4 Replies)
Discussion started by: travegre
4 Replies

10. Shell Programming and Scripting

Rsync help - unable to delete the Source file

Hi All, I am facing problem deleting Source while using the rsync command. rsync --include=*`date --date="-1 day" \+\%Y\%m\%d`* --include=*`date +\%Y\%m\%d`* --exclude=* --delete-after -auvb -e ssh USER@SERVER:SOURCE DESTINATION However the sync happens but not the deletion of the source... (1 Reply)
Discussion started by: amitkhiare
1 Replies
Login or Register to Ask a Question