I am trying to design a custom backup, where (with some exceptions) a backup folder perfectly mirrors a target folder and its subfolders. I have a few questions below. If there is a better way to mirror a target folder, I would love to hear it.
In my mind, this requires 3 tasks:
(1) Trigger on file creation/change => copy file + replace if copy is newer [successful]
(2) If a file is renamed, rename it in the backup. [Not working]
This issue is that I cannot figure out how to get the
original name of the file. Variables=>Triggers=>File=>Result=>Name only returns the value of the
new filename. If I solve this issue, I think I can get it to work.
SO - How do you get the original filename of the triggering renamed file?
(3) If a file is deleted, delete it on the mirror. [Partially working]
Here, the problem is getting the path within the subfolder structure. The two options I see are to use the Trigger file result:
(a) Name, which deletes ALL instances of the filename within the target folder (not just the one I actually deleted). For example, if I have a bunch of files named 'log.txt', and I delete one in the source folder, it deletes ALL of the files named 'log.txt' in the mirrored folder, regardless of where in the subfolder structure they reside.
(b) Path. The issue here is that the variable value is the full-path of the file, including the drive name, and any superfolders containing my target folder. I just want to capture the path name starting at the target folder, so I can create a file mask that deletes ONLY the 'log.txt' file in that subfolder.
SO - How do you delete only the copy in the appropriate mirrored subfolder? I don't want to manually do this for every sub-folder, and something like this must be possible as in the "copy file" task, if "create subfolders" is selected, it will place the copied file into the correct location and not overwrite every iteration of e.g. 'log.txt'
Cheers in advance,
-Dan
Edited by user
2017-07-07T15:01:34Z
|
Reason: grammar