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
 
Search this Thread
Old 04-24-2008, 11:35 AM   #1
mahmoud
Member
 
Registered: Apr 2006
Location: UK
Distribution: Mandriva, Debain, Redhat, Fedora, Ubuntu, FreeBSD
Posts: 269

Rep: Reputation: 30
rsync question


Hi
i am a bit confused first i have a nas storage device and a external hard disk
i mounted the storage device on /mnt
and the external hard drive on /media/disk
my goal is to copy from the storage device to the external hard disk so i did
rsync -vac --stats --delete /mnt/ /media/disk/fileserver-backup/

and this was the out put i was getting
deleting mnt/Contacts/Clients/.............

deleting mnt/Contacts/Clients/...............

deleting mnt/Contacts/Clients/...............

deleting mnt/Contacts/Clients/................

deleting mnt/Contacts/Clients/............

deleting mnt/Contacts/Clients/............

deleting mnt/Contacts/Clients/..............

deleting mnt/Contacts/Clients/..............

deleting mnt/Contacts/Clients/...........

deleting mnt/Contacts/Clients/...........

deleting mnt/Contacts/Clients/..........

deleting mnt/Contacts/Clients/..........

deleting mnt/Contacts/Clients/..........
that is just part of the output before i stopped it also the ......
is for security reasons
my question is why is it deleting the stuff on the storage device when the command stated

rsync [OPTION...] SRC... [DEST]

if it isnt deleting what is on the storage device what is it deleting
 
Old 04-24-2008, 02:15 PM   #2
keratos
Member
 
Registered: May 2007
Location: London, UK.
Distribution: Major:FC8. Others:Debian;Zenwalk; Arch; Slack; RHEL.
Posts: 544

Rep: Reputation: 30
--delete will delete files from the SENDING side.

what are you trying to do EXACTLY.

i.e. are you trying to:

Clone a directory/filesystem?
or
Create a set of one-off backups?
or
Create incremental backups?
 
Old 04-25-2008, 04:13 AM   #3
mahmoud
Member
 
Registered: Apr 2006
Location: UK
Distribution: Mandriva, Debain, Redhat, Fedora, Ubuntu, FreeBSD
Posts: 269

Original Poster
Rep: Reputation: 30
i was trying to back up the file on the storage device to the external drive
the external drive had a copy of the backups but it was about a few weeks old
so i was trying to update it so i can work on the storage device
 
Old 04-25-2008, 04:27 AM   #4
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
No, --delete deletes at the destination. What's happening is rsync compares what you are sending with what's there and because you have the delete option is cleaning up.
 
Old 04-25-2008, 04:29 AM   #5
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
From man rsync

Quote:
--delete
This tells rsync to delete extraneous files from the receiving side (ones that aren't on the sending side), but only for
the directories that are being synchronized. You must have asked rsync to send the whole directory (e.g. "dir" or
"dir/") without using a wildcard for the directory's contents (e.g. "dir/*") since the wildcard is expanded by the shell
and rsync thus gets a request to transfer individual files, not the files' parent directory. Files that are excluded
from transfer are also excluded from being deleted unless you use the --delete-excluded option or mark the rules as only
matching on the sending side (see the include/exclude modifiers in the FILTER RULES section).

Prior to rsync 2.6.7, this option would have no effect unless --recursive was in effect. Beginning with 2.6.7, deletions
will also occur when --dirs (-d) is in effect, but only for directories whose contents are being copied.

This option can be dangerous if used incorrectly! It is a very good idea to run first using the --dry-run option (-n) to
see what files would be deleted to make sure important files aren't listed.

If the sending side detects any I/O errors, then the deletion of any files at the destination will be automatically dis‐
abled. This is to prevent temporary filesystem failures (such as NFS errors) on the sending side causing a massive dele‐
tion of files on the destination. You can override this with the --ignore-errors option.

The --delete option may be combined with one of the --delete-WHEN options without conflict, as well as --delete-excluded.
However, if none of the --delete-WHEN options are specified, rsync will currently choose the --delete-before algorithm.
A future version may change this to choose the --delete-during algorithm. See also --delete-after.
 
Old 04-25-2008, 06:13 AM   #6
mahmoud
Member
 
Registered: Apr 2006
Location: UK
Distribution: Mandriva, Debain, Redhat, Fedora, Ubuntu, FreeBSD
Posts: 269

Original Poster
Rep: Reputation: 30
So basically it was not deleting my files because it cause me quite a scare and also i checked for the files there were still there but from the out put that was the folders it was supposed to be deleting anyway thanks for you help next time i will definitely use a dry run first
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rsync question Fill Linux - Newbie 2 10-01-2007 05:30 PM
rsync question hepburnenthorpe Linux - General 1 11-19-2006 06:19 PM
rsync question nazs Linux - Software 1 10-23-2006 08:31 PM
rsync question kpachopoulos Linux - General 3 07-15-2005 04:33 PM
rsync question falco365 Programming 4 05-25-2003 10:24 AM


All times are GMT -5. The time now is 10:08 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