mailinglists@net-virtual.com
2003-Nov-11 14:02 UTC
Deleting a remote file when deleted locally...
Hello, I have several individual files in a directory that I want to keep syncronized. Here's an example: Server #1 (host): /tmp/file1 /tmp/file2 Now of course I can run "rsync -a /tmp/file1 remoteuser@remotehost:/tmp"... But, when I delete /tmp/file1 from the host and try to run this it complains about /tmp/file1 being non-existant... Can I force (or using a more elegant method) make the remote server delete an individual file if it no longer exists on the host?... Obviously I do not want to rsync the entire directory, I just want that single file to be transferred... Oh, one more thing: a solution which involves relocating the file to a different location is not possible in this environment.... I really need to be able to deal with an individual file, not an entire directory.. Thanks! - Greg
mailinglists@net-virtual.com [mailinglists@net-virtual.com] wrote:> Hello, > > I have several individual files in a directory that I want to keep > syncronized. Here's an example: > > > Server #1 (host): > /tmp/file1 > /tmp/file2 > > Now of course I can run "rsync -a /tmp/file1 remoteuser@remotehost:/tmp"... > > But, when I delete /tmp/file1 from the host and try to run this it > complains about /tmp/file1 being non-existant... > > Can I force (or using a more elegant method) make the remote server delete > an individual file if it no longer exists on the host?... Obviously I do > not want to rsync the entire directory, I just want that single file to be > transferred...Did you notice the --delete option in the rsync manpage? Does that not do what you want here? -- Hardy Merrill Red Hat, Inc.