Anyone know why:
Would delete files from the destination that don't exist on the source (as it is supposed to), but:
Doesn't? There is nothing "funky" about the files (as far as I can tell) that don't get delete by the second command - in other words, they don't start with a "." or anything. For the record (not that it matters) the files that weren't removed from the destination after I deleted them from the source were: postgrey_whitelist_recipients.rpmnew postgrey_whitelist_clients.rpmnew postgrey_whitelist_clients.local.rpmnew TIA! asked 04 May '10, 04:17 Acorp |
From the man page:
As we can see, it expects you to pass the directory containing the files (/path/to/directory/) - not the files themselves (/path/to/directory/*). answered 04 May '10, 04:28 feinom Thanks, that makes sense. So, a corollary question: I have the following files in my source directory: 1.one 1.two 1.three 2.one 2.two 2.three I only want to back up *.one files, so I run the following rsync command: rsync -azuv --delete source/*.one dest/ Perfect, I get 1.one, 2.one, and 3.one in the dest. But say 1.one gets deleted from my source directory. When my rsync command is run again, it doesn't delete 1.one from dest. Without creating complex --include-from --exclude-from, is there a way to make rsync do what one would expect in this situation using wildcards?
(04 May '10, 05:14)
Acorp
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. This means you can't use source/*, because it contains a wildcard. Check out the --files-from=FILE switch in rsync's manual. This allows you to create a file containing a list of the files you want to copy.
(09 May '10, 16:49)
feinom
|
--delete does not appear to take any arguments: it's just a switch! However, using "/etc/postfix/*" on the shell (without the quotes) will get expanded (by the shell) to all files in /etc/postfix, therefore you're basically passing a list of existing source files (and not a directory to "compare"). You want to just pass the directory only. answered 06 May '10, 17:10 daniel.hahle... |