LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 01-10-2008, 04:17 PM   #1
subzero80
LQ Newbie
 
Registered: Jan 2003
Posts: 28

Rep: Reputation: 15
Question Rsync keeps deleting another dir


I am trying to run the command below to sync are development server to our production server. For some reason it keeps giving me the results below which I have no clue why it keeps doing that.

On development server:
development$ rsync -avb --delete -n --exclude "*bak" /srv/websites/hold/test/ production:/srv/websites/hold/test/

results
created directory /srv/websites/hold/test/ <-- Correct since the folder is not on the production server.

Below is not correct! It's trying to delete everything from my home dir on the production server. I have no clue why it is doing that. Does anyone have feedback on what is causing this? Thanks for the help.

deleting .zshrc
deleting .ssh/known_hosts
deleting .ssh
deleting .emacs
deleting .bashrc
deleting .bash_profile
deleting .bash_logout
deleting .bash_history
 
Old 01-10-2008, 04:51 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Their non-existance on the source machine in the directory test?



Cheers,
Tink
 
Old 01-11-2008, 08:49 AM   #3
subzero80
LQ Newbie
 
Registered: Jan 2003
Posts: 28

Original Poster
Rep: Reputation: 15
Their is files in the test dir on development system. It creates the the folder and copies the files but then it tries to erase my home dir on the production server while it is sync the data.
 
Old 01-11-2008, 01:14 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Check on the destination box whether there's dot-files in the target
directory. If there are (I can't tell you how they got their, maybe
you did a previous run from a different source dir?) - and I'm pretty
certain there will be - the command you issued will rightfully try to
delete them since you explicitly asked it to.



Cheers,
Tink

Last edited by Tinkster; 01-12-2008 at 01:49 PM. Reason: bad spelling rubbing of
 
Old 01-11-2008, 03:59 PM   #5
subzero80
LQ Newbie
 
Registered: Jan 2003
Posts: 28

Original Poster
Rep: Reputation: 15
The dot files are in my /home/MY user dir on the production server. For some strange reason it's trying to delete the contents of my home dir. It does the same thing with another login account. So I am really confused on what is causing this.

deleting .zshrc
deleting .ssh/known_hosts
deleting .ssh
deleting .emacs
deleting .bashrc
deleting .bash_profile
deleting .bash_logout
deleting .bash_history
 
Old 01-12-2008, 01:29 AM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
I appreciate that those dot-files also exist in your home,
they would on many a linux machine. What I'm trying to say is
that rsync is too mature to try and delete stuff from a spot
that it clearly has no dealings with. Also the deletion would
happen on the target end, not on the sender.

Did you bother to check the target directory on the server
for the existence of those files?



Cheers,
Tink
 
Old 01-12-2008, 01:42 PM   #7
xptools
Member
 
Registered: Sep 2005
Location: Canada
Distribution: Debian Testing
Posts: 40

Rep: Reputation: 15
Quote:
Originally Posted by Tinkster View Post
Their non-existance on the source machine in the directory test?
subzero80, it seems you had never answered Tinkster's above question.

The files (.zshrc etc) to be deleted are not from your home directory but from production:/srv/websites/hold/test/. Are you sure you want them to be there?

Get familiar with rsync first, see Suggested rsync usage.
 
Old 01-14-2008, 09:32 AM   #8
subzero80
LQ Newbie
 
Registered: Jan 2003
Posts: 28

Original Poster
Rep: Reputation: 15
Question

There is no /test/ dir on the production server. Rsync suppose to create the directory which is does. I created a test file in my /home dir on the production server to see if that is the location it is trying to delete from. It is trying to delete files from my home dir on production server. I tried the --delete-after option to see if that would correct the issue but it still gave me the same result.

deleting websites
deleting testk <--- This is a file that I created in home dir on production server.
deleting .zshrc
deleting .ssh/known_hosts
deleting .ssh
deleting .emacs
deleting .bashrc
deleting .bash_profile
deleting .bash_logout
deleting .bash_history
 
Old 01-15-2008, 03:14 PM   #9
subzero80
LQ Newbie
 
Registered: Jan 2003
Posts: 28

Original Poster
Rep: Reputation: 15
I figured it out. For some reason if I don't remove the test/ <-- "/" on the source directory it will try to delete everything on my production home dir. Must be something with creating folder.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Command to display /dir, /dir/sub, /dir/sub/files knockout_artist Linux - Newbie 9 10-25-2007 02:57 PM
how to do yes to all when deleting a dir recursively dr_zayus69 Linux - Newbie 6 12-02-2004 02:42 AM
rsync not deleting bwilliam79 Linux - Software 1 10-04-2004 05:22 PM
Installing Fedora without deleting home dir eggi Fedora - Installation 2 07-17-2004 03:50 PM
How can I stop rsync from deleting data if network link is dropped? skyfly Linux - Networking 2 06-30-2004 10:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration