I need help creating versioning with crypt to dated folders

python is simple syntax and is easy to read, does not have {} and ;
i get a context sensitive ide and a debugger.

for anything you want to, there is a library for it.
i mentioned that i have a 300+ line python script.

for example, i use keepass to store passwords, each time i want to run keepass, i run this script, it will backup keepass and then start keepass for me.
same thing with firefox, i run this script, tell it to backup firefox and then start firefox for me.

it reads config info from an .ini file, there is a section for each backup job.
for example,

[keepass]
SourceDir=C:\data\u\keepass
DoVShadow=true
DoFastCopy=true
DoZip=true
DoRcloneSyncZip=true
DoRcloneCheckZip=true
DoRcloneSyncFiles=true
DoPostOp=true
UseArchiveDir=true
SendEmailLogs=true
NetUse=true
PostOpCmd=C:\data\rclone\scripts\rr\postop\start_keepass.cmd

in this example, i want to backup keepass and i can do that in many ways

  1. enable VSS
  2. use fastcopy to copy the local source files to my local backup server.
  3. create a zip file of the local sources file and copy that to my local backup server.
  4. rclone sync that zip file to wasabi
  5. rclone check that zip file on wasabi
  6. rclone sync the source files to wasabi
  7. rclone check the source files on wasabi
  8. use --backup-dir for rclone commands
  9. after the backup has finished, analyze the logs files for errors and then email the following logs to me. fastcopy log, 7zip log, rclone log, vss log.
  10. Netuse - as a paranoid feature, the script creates an on-the-fly net use a: \\backupserver\backupfolder to the backup server, files are copied to that a: drive.
    and after the backup to the backup server net use a: /delete /y . in that way, if the source computer was infected with ransomware, it would not be to access the backup server.
    another paranoid feature, the username and password for net use are encrypted and cannot be seen from task manager.
    and you might think that you could modify the batch file that run rclone, to get the net use username and password, but this is not possible, yet another paranoid feature, as those batch files that run rclone, fastcopy, zip are encrypted.
    i decrypt the .cmd batch file on-the-fly, copy that batch file to the temp folder, execute the decrypted batch file, then the decrypted batch file is zeroed out, and then delete the decrypted batch file. and the username and passwords are written to the registry, then the .cmd batch file reads the passwords from registry, zeros out the registry entries and executes the .cmd file, then deletes the .cmd file
  11. as the last step, run the post-op command, which will launch keepass

the script can be run one-time or in daemon mode.
i use veeam agent to backup windows desktop/laptop computers and those backups can be large, 80GB+ for a full backup,
so on the laptop i have a batch file that starts veeam backup, which backups up to that backup server, but now i need to get the veeam backup files on the cloud, if i run rclone on the client, it can slow down and takes many hours, perhaps overnight and the end-user might have to take their laptop with them off-site.
on the backup server, the python script runs in daemon mode.
so after veeam have finished, the local script sends a signal to the python script running on the backup server, and then the backup server uses rclone to copy to wasabi.


RcloneDestFilesDir=             f'{RcloneDest}:{RcloneDestPrefix}\\{BackupName}\\rclone\\backup\\'
RcloneArchiveFilesDir=          f'{RcloneDest}:{RcloneDestPrefix}\\{BackupName}\\rclone\\archive\\{TheDateTime}\\'

RcloneSyncFilesCmd =            f'{ScriptsDir}\\rclone.exe  sync  "{SourceDir}"   {RcloneDestFilesDir} {RcloneSyncFilesCmdFlags}  {RcloneLogFlags}'
2 Likes