Thank you Shachar for replying quickly.
I don't know the number of directories because I run rsyncrypto inside a wrapper and I don't know in advance what path would be submitted to it. What I wanted to do was to trim all the directories except the last one. Since I give the path to rsyncrypto as a parameter it would easyly be able to automaticaly calculate the number of directories to trim.
But don't worry I cleary understood your point. You want rsyncrypto to do is own job and do it well. You don't want it to do other's job. And you are right. It makes the program more stable.
David V. wrote:
> The trim option in rsyncrypto is a very smart and usefull feature.
> It would be nice if it could also do something else :
> Suppose I ask rsyncrypto to crypt C:\folder1\folder2\folder3\ with the
> -r option :
> I will have
> What I would like is the possibility to have
That's what "--trim=4" does.
> I dont know in advance the number of folders to trim. I would like
> rsyncrypto to do it automatically.
> Is this possible ?
If you don't know how many directories to trim, how can rsyncrypto?
> David V.
I think you are mistaking rsyncrypto for something it isn't. Rsyncrypto
is there for performing batch encrypting of files in an rsync friendly
way. The only features that are planned to go in are those that are
necessary for the encryption and for allowing batch operations. I would
much rather complicated file manipulations to go in as a pre or a post
I think having rsyncrypto be able to do complicated file renames (beyond
those that are part of the encryption process itself, as is the case
with -n) is out of the scope of what rsyncrypto is meant to do.
In much the same way, I don't think rsyncrypto should have more
sophisticated file matching criteria. Doing "find whatever | rsyncrypto
--filelist - foo bar whatever.crt" ought to be good enough (but it
should have an option to pipe find's "-print0" output). This is on par
with the fact that I don't think rsync should be able to do encryption.