Hans Deragon
2008-Jan-15 18:21 UTC
Feature Request: Options to limit --one-file-system at the source or destination.
Greetings. Currently, the --one-file-system applies to both the source and destination and this is a problem. In my source, I have a symlink pointing to a directory on another device which I would like to have copied. I thus use --copy-unsafe-links. I also use --delete. This is dangerous because if there is a bug in my script, I would not like the destination to become suddenly / and deletion occurs on mounted network drives (granted, the machine would be toast, but the damage would be limited to the machine; not the corporate network). If I make use of --one-file-system, the symlink at the source gets ignored. So I need a --one-file-system option that applies only to the destination, probably named something like --one-file-system-at-destination. Could that be easily implemented? The following two options would be nice: --one-file-system-at-source # Limit to one file system at the source. --one-file-system-at-destination # Limit to one file system at the destination. Best regards, Hans Deragon -- Consultant en informatique/Software Consultant Deragon Informatique inc. http://www.deragon.biz Open source (contribution): mailto://hans@deragon.biz http://autopoweroff.sourceforge.net
Matt McCutchen
2008-Jan-15 18:41 UTC
Feature Request: Options to limit --one-file-system at the source or destination.
On Tue, 2008-01-15 at 13:21 -0500, Hans Deragon wrote:> Currently, the --one-file-system applies to both the source and > destination and this is a problem. > > In my source, I have a symlink pointing to a directory on another > device which I would like to have copied. I thus use > --copy-unsafe-links. > > I also use --delete. This is dangerous because if there is a bug in > my script, I would not like the destination to become suddenly / and > deletion occurs on mounted network drives (granted, the machine would > be toast, but the damage would be limited to the machine; not the > corporate network). > > If I make use of --one-file-system, the symlink at the source gets > ignored. So I need a --one-file-system option that applies only to > the destination, probably named something like > --one-file-system-at-destination. > > Could that be easily implemented? The following two options would be > nice: > > --one-file-system-at-source > # Limit to one file system at the source. > > --one-file-system-at-destination > # Limit to one file system at the destination.This is a good feature request and would be easy to implement. However, if the source contains only a small, fixed set of cross-filesystem symlinks that you want to follow, a quicker solution would be to use --relative and provide for each such symlink an additional source argument that reaches through it, starting a new --one-file-system traversal at its target. This approach also avoids the need for --copy-unsafe-links. For example, if you want to copy ~/src to ~/dest and have rsync follow a symlink ~/src/extrafiles -> /tmp/extrafiles to obtain additional source files, you would run: rsync -r --relative --one-file-system \ ~/src/./ ~/src/./extrafiles/ ~/dest/ Another approach is to use protect filters instead of --one-file-system as a precaution against undesired deletions. Matt
Hans Deragon
2008-Jan-15 21:38 UTC
Feature Request: Options to limit --one-file-system at the source or destination.
Matt McCutchen wrote:> On Tue, 2008-01-15 at 13:21 -0500, Hans Deragon wrote: >> Currently, the --one-file-system applies to both the source and >> destination and this is a problem. >> >> In my source, I have a symlink pointing to a directory on another >> device which I would like to have copied. I thus use >> --copy-unsafe-links. >> >> I also use --delete. This is dangerous because if there is a bug in >> my script, I would not like the destination to become suddenly / and >> deletion occurs on mounted network drives (granted, the machine would >> be toast, but the damage would be limited to the machine; not the >> corporate network). >> >> If I make use of --one-file-system, the symlink at the source gets >> ignored. So I need a --one-file-system option that applies only to >> the destination, probably named something like >> --one-file-system-at-destination. >> >> Could that be easily implemented? The following two options would be >> nice: >> >> --one-file-system-at-source >> # Limit to one file system at the source. >> >> --one-file-system-at-destination >> # Limit to one file system at the destination. > > This is a good feature request and would be easy to implement. > > However, if the source contains only a small, fixed set of > cross-filesystem symlinks that you want to follow, a quicker solution > would be to use --relative and provide for each such symlink an > additional source argument that reaches through it, starting a new > --one-file-system traversal at its target. This approach also avoids > the need for --copy-unsafe-links. For example, if you want to copy > ~/src to ~/dest and have rsync follow a symlink ~/src/extrafiles > -> /tmp/extrafiles to obtain additional source files, you would run: > > rsync -r --relative --one-file-system \ > ~/src/./ ~/src/./extrafiles/ ~/dest/ > > Another approach is to use protect filters instead of --one-file-system > as a precaution against undesired deletions. > > MattGreetings Matt. Mmm. None of the solutions you presented to me would be satisfying. For the moment, a got ride of the symlinks at the source by recopying the files from the other device (have a script to update them). Not ideal, but it does the job. Thank you for the quick response. Hans Deragon -- Consultant en informatique/Software Consultant Deragon Informatique inc. http://www.deragon.biz Open source (contribution): mailto://hans@deragon.biz http://autopoweroff.sourceforge.net
Possibly Parallel Threads
- Feature request: Being able specify that the destination should follow source directory structure.
- rsync server complaining about vanishing files while they are not.
- [Fwd: Re: rsync server complaining about vanishing files while they are not.]
- DO NOT REPLY [Bug 5223] New: Options to limit --one-file-system at the source or destination.
- How come fsck still kicks in and reports major errors with Ext3?