Moving old files before using sync folders command
Posted: 15 Aug 2021 05:28
Hi
I am seeking a way to archive the files & folders that would normally be overwritten or deleted by the sync folders command.
I normally use sync folders from C:\Jobs to D:\Jobs and get the expected behaviour, but would like a script that can be run beforehand that would identify the files that sync would overwrite or delete and copy them to another folder.
For example if a change in C:\Jobs since last synchronization was deleting the file C:\Jobs\Welding\specs.pdf then the "archive" script would copy the file (now unique to the D: drive) to D:\Archive\2021-08-15\Welding\specs.pdf before the sync command deleted it from the D:\Jobs... folder.
Likewise if the following day a change was that the file "bills.xls" in the C:\Jobs\Finance\ folder was edited then the older one (existing on the D: drive) would be copied to D:\Archive\2021-08-16\Finance\bills.xls before being overwritten during the sync.
Conceptually the overall result (after the sync command) would be the same whether the obsolete file is Copied or Moved to the archive folder, but I guess it's existence wouldn't feature in the sync log file if it was Moved by the "archive" script before the sync was run.
Is this something anyone has attempted before?
Regards, Colin
I am seeking a way to archive the files & folders that would normally be overwritten or deleted by the sync folders command.
I normally use sync folders from C:\Jobs to D:\Jobs and get the expected behaviour, but would like a script that can be run beforehand that would identify the files that sync would overwrite or delete and copy them to another folder.
For example if a change in C:\Jobs since last synchronization was deleting the file C:\Jobs\Welding\specs.pdf then the "archive" script would copy the file (now unique to the D: drive) to D:\Archive\2021-08-15\Welding\specs.pdf before the sync command deleted it from the D:\Jobs... folder.
Likewise if the following day a change was that the file "bills.xls" in the C:\Jobs\Finance\ folder was edited then the older one (existing on the D: drive) would be copied to D:\Archive\2021-08-16\Finance\bills.xls before being overwritten during the sync.
Conceptually the overall result (after the sync command) would be the same whether the obsolete file is Copied or Moved to the archive folder, but I guess it's existence wouldn't feature in the sync log file if it was Moved by the "archive" script before the sync was run.
Is this something anyone has attempted before?
Regards, Colin