Conditional backup on USB

Get help for specific problems
Posts: 1
Joined: 3 Oct 2015

edwin-buis

Yes, you can automate a backup on inserting an USB device with RealTimeSync. But if you had a crashed HD, and placed an Image of the data partition back, the last thing that you're waiting for is that your inserted USB drive is immediately overwriten with the old data. The description here helps you with a popup screen where you can chose to yes/no run the backup to USB device

Ok, Let's start:

First we place on the USB stick a map called Do_Not_Remove
This map will trigger a Realtimesync process that is started at system start, and is configured to watch for the arrival of an USB stick with named map on it
When its triggered it will start the following vbsscript
...................................................................................................................................................................

dim result
result = msgbox("Do you want to rework the backup?", 4 , "Backup dialoog screen")
If result=6 then
Dim objShell
Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Run("""C:\Users\Username\Mirror_Data_Username_to_Y.ffs_batch""")
Set objShell = Nothing
else
msgbox "Ok, You can still open your USB in Explorer to retrieve old version files"
end if
...............................................................................................................................................................

If you copy paste the text between the lines in a simple texteditor, and replace the .txt by .vbs you will get a executable script file. I called the script Run_Backup_Conditionally.vbs

The line objShell.Run("""C:\Users\Username\Mirror_Data_Username_to_Y.ffs_batch""") refers to the place where your backup batch process is placed. the name of the batchprocess is trivial. I named it Mirror_Data_Username_to_Y.ffs_batch, with Username replaced by the actual username of course, and Y because I assigned that letter to the USB device.
Try it...It works like a charm...
Why the Do_Not_Remove map? Because the backup process changes the other map, which would cause a restart of the script file...

PS1
One drawback is that you have to stop the normal pop up when an USB device is inserted:
Start > Configuration screen > Hardware and Sounds > automated play > uncheck the box Use automated play for all media and hardware (Win10, translated from Dutch, so it may be a little different different)

Ps2
How to set up the RealTimeSync to make it an constantly running background process?
* Configure it so that it watches the arrival of the stick with the map Do_Not_Remove on it
* Configure it further to run after the trigger Run_Backup_Conditionally.vbs
* Save as batchfile with a clear name, e.g. Mirror_Data_Username_to_Y.ffs_batch
* Make a shortcut to mamed batchfile. Copy the shotcut
* Start > Task management > File > New Task > Put in textbox shell:startup > ok
* Paste the shortcut in the Startup folder

Hope you like it, Have fun,

Edwin