Hello,
I would like to know if there is any way to update the content of a target folder without creating new files that could have been created on the source meanwhile ?
I found this topic Update only the existing files on a remote side? which led to this kind of workaround :
rclone lsf --files-only -R $dest > dest.txt
rclone copyto $source/$n $dest/$n -v --include-from=dest.txt
And that worked, for a simple test.
Once I tried to make it work for more complex folders with a lot of content in each, I met errors. And blocking errors which stopped the copyto (simulated) command from start.
And if I remove this file line in my reference list, I can't possibly know if I will have a new line to create an issue.
Also, I can't really remove a file line if this very file has to be updated.
Example of my two commands :
rclone lsf --files-only -R DRH: > lsf-DRH.txt
rclone copyto source:"DDRH" DRH:: --dry-run --include-from=lsf-DRH.txt -v --log-file onlyUpdate-DRH.txt
The main issue was regarding a regex. Here is an example of what I got :
(and there is no other content in the generated logfile)
2023/04/14 21:42:19 Failed to load filters: bad glob pattern "04-AF_closes/2016/DD04CA - 25 DAUPHINE/14 PLANS-CALCULS/BET/[BTP-Consultants]_FED_1_2015-06-03.pdf" (regexp "(^|/)04-AF_closes/2016/DD04CA - 25 DAUPHINE/14 PLANS-CALCULS/BET/[BTP-Consultants]_FED_1_2015-06-03\.pdf$"): error parsing regexp: invalid character class range: 'P-C'
To be noted, it was the character ` and not ' that was used in the error message, but it doesn't seem to be accepted by the forum
The thing is I don't get why the string 'P-C' would led to an error.
For other tests, it will trigger that very error for another folders with different strings, such as 'L-E', '6-1' and other similars. There is a clear pattern of two characters separated by a hyphen.
Otherly, I also got for several other tests folders, I had this one :
2023/04/14 22:11:16 Failed to load filters: mismatched ']' in glob "04-AF_closes/KK00W028 - CDEF - AULNAY/FT aulnay/FR] AVANCEMENT RAPPORT DE CLASSIFICATION -CALYSTO L EN2.jpg"
Here even if it seems weird, I am not here to judge why the users had not as many [ than ] in their filenames.
I got another example with three [ and no ] to close them, which led to the same error code.
I have no such issues with a copy --update (--dry-run), so I guess the --include tag works indeed with a maniacal regex.
Is there a way to get through this restrictive and nitpicking regex ? The files are named the same way in the source as they are in the target, even if it is badly.
Would --filtering-from do the trick ? I am not sure to understand how it works (and what it is supposed to do).
Thanks