suppress rsync warning: some files vanished before they could be transferred
Unfortunately, unlike what is described in SWdream solution, --ignore-missing-args
has no impact on vanished files. It will simply ignore source arguments that doesn't exist.
See man rsync
:
--ignore-missing-args When rsync is first processing the explicitly requested source files (e.g. command-line arguments or --files-from entries), it is normally an error if the file cannot be found. This option suppresses that error, and does not try to transfer the file. This does not affect subsequent vanished-file errors if a file was initially found to be present and later is no longer there.
The "official" way of ignoring vanished file is to use this script from the official rsync source repository: https://git.samba.org/?p=rsync.git;a=blob_plain;f=support/rsync-no-vanished;hb=HEAD
which is very similar to what @kenorb and @gilles-quenot said.
The reason is these files were existing while rsync is building the list of files to transfer but they are removed before transferring.
It is a warning massage, not an error. However, you should try to find out why these file was deleted, it is maybe important.
To ignore this warning, you can use --exclude option as above question or use -ignore-missing-args
rsync option, it makes rsync ignores vanished files:
--ignore-missing-args ignore missing source args without error
it maybe helps.
You can use rsync
's exclude switch (--exclude
):
$ rsync -avz --exclude '**/tmp/' source/ destination/
Specified this way --exclude '**/tmp/'
will ignore any path which includes the string /tmp/
. You can provide patterns to this arguments as well.
Example
$ rsync -avz --exclude '/path/to/*/tmp/' source/ destination/
Will exclude on paths of the form: /path/to/*/tmp/
.