rsync - How to skip files that are allready copied?
Linux - SoftwareThis 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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
rsync - How to skip files that are allready copied?
I want to copy files from /dev/test to /dev/test2
by cron job every night. First time it will copy all files I know.
But next night I want to copy only new files that are created in /dev/test and skip other files.
I see that
Code:
rsync -u --update
skip files are allready copied, but it updates files that changed in /dev/test
I dont want to update changed files. Only to copy new creted files.
I was looking in rsync manual and I didnot see that option. Any idea for that?
Hm..., I see that --ignore-existing is sub-option of -e
I a little bit confused. What if I want to combine more options? I have to separe them only with space?
Hm..., I see that --ignore-existing is sub-option of -e
I don't know what you're talking about. The "-e" (--rsh) option is used to specify an alternative to the default command to run on the remote system for communication between the local and remote copies of rsync. It has basically nothing to do with "--ignore-existing".
Quote:
I a little bit confused. What if I want to combine more options? I have to separe them only with space?
I didn't realize you where that totally unfamiliar with the command line, but yes, that's the most straightforward way to do it. For any option that takes an argument (and for rsync, "-e" is an example of that), the argument must immediately follow the option. The short (single-letter) options can be combined, so "rsync -v -n ..." is equivalent to "rsync -vn ...". I looked around a bit for a decent tutorial on that, but didn't find anything suitable. Anyone???
-e, --rsh=COMMAND specify the remote shell to use
--rsync-path=PROGRAM specify the rsync to run on remote machine
--existing skip creating new files on receiver
--ignore-existing skip updating files that exist on receiver
--remove-source-files sender removes synchronized files (non-dir)
--del an alias for --delete-during
--delete delete extraneous files from dest dirs
--delete-before receiver deletes before xfer, not during
--delete-during receiver deletes during the transfer
--delete-delay find deletions during, delete after
--delete-after receiver deletes after transfer, not during
--delete-excluded also delete excluded files from dest dirs
--ignore-errors delete even if there are I/O errors
--force force deletion of dirs even if not empty
--max-delete=NUM don't delete more than NUM files
--max-size=SIZE don't transfer any file larger than SIZE
--min-size=SIZE don't transfer any file smaller than SIZE
--partial keep partially transferred files
--partial-dir=DIR put a partially transferred file into DIR
--delay-updates put all updated files into place at end
I have got it from man rsync
I thought that main option is -e and sub option is --ignore-existing
That's because of that way they are presented on man page. Option -e is placed more on the left and I thought is main option.
It's just that the next 19 options after "-e" don't have a short form, and thus the columns where the short form would be shown are blank. Those are all independent options. For the most part, all of the options are independent, though the list does group similar options together for convenience. The detailed descriptions do list some options that imply, or are incompatible with, others, but the formatting of the summary table doesn't reflect any of that.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.