rsync --delete possible when choosing filenames?

I'd like to be able to have rsync copy files I have listed in my bash script and then delete any files that do not exist in the source directory (if i change the file list in the script). Expanded the command looks like this:

rsync -axSR --delete src_dir1/file1 src_dir2/file2 dst_dir/

However, rsync is not deleting extraneous files. Is there a way to do this?

Upvotes: 0

Views: 111

Answers (1)

Chris Henry
Chris Henry

Reputation: 12010

With this syntax, it could be because you are using multiple sources, and those sources are actual files.

Why not just sync the parent directory of src_dir to dst_dir?

Upvotes: 1

Related Questions