You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I noticed a behaviour that I consider unexpected in 2.3.0.A.0.
I wanted dirsync to sync two folders in a way that the destination gets overwritten (updated, purged, new files added, with the exception of .svn folders that are there) completely with all the content.
If found out that it had to be done with the following line of code:
I went through a bit of trouble until I found out that files are represented without its base folder to find a proper regex expression to filter the right files...
Anyway, I change several files in the destination folder before doing some other functions on them; and next time I want them overwritten with the original files.
That didn't seem to be possible with the original options - as if ctime=True was always on.
I found out that I had to change this line of _cmptimestamps function:
I think the behavior you're expecting (mirroring a directory to another) could be obtained using action='update' instead of action='sync'. The update action will bypass the timestamp check and will only be 'one-way' (files in the target directory will never be copied to the source).
Original comment by Igor Krbavcic (Bitbucket: bolon_yokte, ).
I know what you mean. But does that mean I need to use sync and update functions separately to achieve what I need (update of files, copy new files and purge destination from non existing files in source)?
Hi Igor, in the current version of the code, yes you would need to run 'update' first, and then 'sync'. Indeed, 'update' will not copy new files. I think that was the original behavior of the script dirsync comes from and I never changed it. But given the feedback I have on this (with similar issues being reported), I may consider making 'update' actually copy the new files, so that in your case you would only need 'update'. And even rename 'update' by 'mirror' to make it more explicit.
Original report by Igor Krbavcic (Bitbucket: bolon_yokte, ).
Hi, I noticed a behaviour that I consider unexpected in 2.3.0.A.0.
I wanted dirsync to sync two folders in a way that the destination gets overwritten (updated, purged, new files added, with the exception of .svn folders that are there) completely with all the content.
If found out that it had to be done with the following line of code:
I went through a bit of trouble until I found out that files are represented without its base folder to find a proper regex expression to filter the right files...
Anyway, I change several files in the destination folder before doing some other functions on them; and next time I want them overwritten with the original files.
That didn't seem to be possible with the original options - as if ctime=True was always on.
I found out that I had to change this line of _cmptimestamps function:
to this:
for it to work properly (or at lease as I intended it to).
It would be really helpful if documentation is on the level of the software itself... ;)
Otherwise thank you for the very useful code.
Regards,
Igor
The text was updated successfully, but these errors were encountered: