Trailing Slash Inconsistencies

Mark J de Jong dejongm at secdog.com
Tue Dec 3 15:54:00 EST 2002


Dave, thanks for the response! I read my command over at least 10 times
to make sure there wasn't a mistake and now I finally noticed one. The
second command should read:

rsync -va --stats --timeout=1800 --exclude-from=exclude.list --delete
--port=11111 -R user at 127.0.0.1::backup/home/ /home/backup1/hostname/stage/

Notice the module name is "backup." I'm not sure if this would make a
difference with your explanation. However, in my scenario I need the
'-R' option because the backup process is run by a script and is backing
up about 20 different machines with multiple directories from each
machine. The script pulls all relevant information from a database and
dynamically constructs the command. The module "backup" is the root of
the server and I need the path on the destination to be relative to
root. The destination will always be /home/backup1/hostname/stage.

Thanks,
Mark 

On Tue, 2002-12-03 at 10:11, Dave Dykstra wrote:
> I didn't test this out myself, but I have a couple comments.  One is to
> note the two scenarios are quite different internally to rsync because in
> the second case "home" is the name of a rsyncd.conf module and not just
> a path.  Secondly, the -R option is not used very often and may behave
> in some unexpected ways.  It's certainly not needed in this case because
> you can always control whether or not the destination path has an extra "home"
> at the end.  Try the two without -R.
> 
> - Dave Dykstra (who hasn't posted lately because I'm looking for a new job)
> 
> 
> On Wed, Nov 27, 2002 at 10:13:06AM -0500, Mark J de Jong wrote:
> > Hello, 
> > I am noticing inconsistencies when using a trailing slash on the source
> > directories in conjunction with the '--delete' option. In one instance
> > when using a trailing slash files get deleted from subdirectories in the
> > destination tree. In the other instance they don't. I am using rsync
> > 2.5.5. The following are the scenarios:
> > 
> > Scenario 1
> > ----------
> > *nix(src) ---> *nix(dest)
> > 
> > rsync -va --stats --timeout=1800 --exclude-from=exclude.list --delete -R
> > -e ssh user at 192.168.0.10:/home/ /home/backup1/hostname/stage/
> > 
> > In this instance files in destination /home/backup1/hostname/stage/DIR
> > would get deleted.
> > 
> > 
> > Scenario 2
> > ----------
> > windows(src) --ssh tunnel--> *nix(dest)
> > 
> > The windows machine is running rsync in daemon mode. I create a ssh
> > tunnel from the unix machine to the windows machine and port forward
> > from a random port and then run the following command:
> > 
> > rsync -va --stats --timeout=1800 --exclude-from=exclude.list --delete
> > --port=11111 -R user at 127.0.0.1::/home/ /home/backup1/hostname/stage/
> > 
> > In essence it's the same as the last command except in this case files
> > in the destination /home/backup1/hostname/stage/DIR do not get deleted.
> > When I remove the the trailing slash from the source directory (/home)
> > everything works fine.
> > 
> > Is this by design or might this be a bug?
> > 
> > Thanks,
> > 
> > 
> > -- 
> > To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync
> > Before posting, read: http://www.tuxedo.org/~esr/faqs/smart-questions.html
> 





More information about the rsync mailing list