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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
04-24-2008, 10:35 AM
|
#1
|
|
Member
Registered: Apr 2006
Location: UK
Distribution: Mandriva, Debain, Redhat, Fedora, Ubuntu, FreeBSD
Posts: 269
Rep:
|
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
|
|
|
|
04-24-2008, 01:15 PM
|
#2
|
|
Member
Registered: May 2007
Location: London, UK.
Distribution: Major:FC8. Others:Debian;Zenwalk; Arch; Slack; RHEL.
Posts: 531
Rep:
|
--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?
|
|
|
|
04-25-2008, 03:13 AM
|
#3
|
|
Member
Registered: Apr 2006
Location: UK
Distribution: Mandriva, Debain, Redhat, Fedora, Ubuntu, FreeBSD
Posts: 269
Original Poster
Rep:
|
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
|
|
|
|
04-25-2008, 03:27 AM
|
#4
|
|
Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep: 
|
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.
|
|
|
|
04-25-2008, 03:29 AM
|
#5
|
|
Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep: 
|
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.
|
|
|
|
|
04-25-2008, 05:13 AM
|
#6
|
|
Member
Registered: Apr 2006
Location: UK
Distribution: Mandriva, Debain, Redhat, Fedora, Ubuntu, FreeBSD
Posts: 269
Original Poster
Rep:
|
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
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Similar Threads
|
| Thread |
Thread Starter |
Forum |
Replies |
Last Post |
|
Rsync question
|
Fill |
Linux - Newbie |
2 |
10-01-2007 04:30 PM |
|
rsync question
|
hepburnenthorpe |
Linux - General |
1 |
11-19-2006 05:19 PM |
|
rsync question
|
nazs |
Linux - Software |
1 |
10-23-2006 07:31 PM |
|
rsync question
|
nocturna_gr |
Linux - General |
3 |
07-15-2005 03:33 PM |
|
rsync question
|
falco365 |
Programming |
4 |
05-25-2003 09:24 AM |
All times are GMT -5. The time now is 07:08 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|