Backup instead of delete when syncing

Advertisement

Shelter
Joined:
Posts:
2

Backup instead of delete when syncing

Scenario: on synching local files with remote forder with -delete option, the deleting need to be delayed for certaing time to avoid file loss in case of unauthorized file deletion is the source. This is usefull for backup files replication from the external source to the local copy.

Possible implementation 1:
-delete option with additional option with value "deleted file extension" does not remove file but renames one by adding "deleted file extension".

Possible implementation 2:
-delete option with additional option with value "deleted file folder" only moves the deleted files to this folder (with the same relative path).

Reply with quote

Advertisement

Shelter
Joined:
Posts:
2

Re: Backup instead of delete when syncing

Best decission IMHO:
When -delete with special option "delta" is used then
if no a remote file for the local then
    if archived=1 (file attribute. =1 by defalut) then
        set lastMofified = <current time>
        set archived=0
    else
        if lastMofified  < <current time> - <delta> then
            delete file
else
    if archived=0 then
        set archived=1

Reply with quote

Advertisement

You can post new topics in this forum