rsync deletes original directory


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users rsync deletes original directory
# 1  
Old 12-29-2009
rsync deletes original directory

Hi

I have a strange problem. Sometimes when I execute the below command something wierd happens.
Code:
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-30-2009 at 01:27 AM.. Reason: added code blocks
# 2  
Old 01-05-2010
That is strange.

All I can think of is rsync getting the source and destination confused.

Are you specifying any of the --delete , --delete-before, --delete-during, --delete-after options by any chance?
# 3  
Old 01-05-2010
no, just the: rsync -avz -e ssh travegre@travegre.net: ../travegre.net/

Would it be better if I do specify one of these, would that help him get it right?Smilie
# 4  
Old 01-11-2010
You might try using an absolute instead of relative path.

Since you're mixing ssh in with that it's a bit beyond my knowledge.
# 5  
Old 01-11-2010
thanks, i'll try
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. Shell Programming and Scripting

Remove original file from directory after bash executes

The below bash works great, except I can not seem to delete the original file $f from the directory. Thank you :) For example, after the bash executes there are 8 files in the directory: 123.txt (original file) 123_remove.txt 123_index.txt 123_final.txt 456.txt (original file)... (11 Replies)
Discussion started by: cmccabe
11 Replies

3. Shell Programming and Scripting

Rsync defined directory

i want to copy with rsync a specified (sub)-directory and the according folders and files below. my test failed : cd /dir /usr/bin/rsync -ravz -e ssh --include='*/' --include='*/00/*/*' --exclude='*' . remote_host:/tmp i want to copy in these example the directory "00" and the according... (2 Replies)
Discussion started by: bora99
2 Replies

4. Shell Programming and Scripting

rsync: skip mail directory

i want to skip the /home/user/mail directory in an rsync but only in this level not like /home/user/public_html/anotherscript/mail if i have a command like this rsync -av --exclude mail /home/$USER root@$SERVERIP:/home2 does it exclude only the mail directory directly under... (1 Reply)
Discussion started by: vanessafan99
1 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. UNIX for Dummies Questions & Answers

diff original new ignoring changes, just adds and deletes

Hi everyone, I have 2 very large files (each file have about 600k lines) and I want to see which numbers in file1 are not in file2, I thought of doing a diff, however diff will also display the changes, instead of just adds and delete, this makes it very hard to sort out just the adds and deletes.... (1 Reply)
Discussion started by: robertrobert905
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

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... (1 Reply)
Discussion started by: travegre
1 Replies

10. Shell Programming and Scripting

rsync mirror of download directory

I have a download directory for NDM Secure+ to receive files from other system. I need to mirror this directory to another box, but need to skip files that are still coming in. I have no control over file names or destination directories as they are configured on the sending side. How can I... (2 Replies)
Discussion started by: wskibum
2 Replies
Login or Register to Ask a Question