Sometimes I close my laptop a little brutally fast, and as a by-product I got UDC and other *.DAT files reset to their "Default" state.
probably they where being saved by XY while the laptop was closing everything.
I unchecked "save on exit". And all is good. But While trying to recover from those .dat resets I found out that, although I had backups, they where old and not so many.
to be more on the safe side I would like to have a script that would backup the application data folder in a zip sequentially named by the date.
Thanks
Claude
save application folder in a zip
Re: save application folder in a zip
Something like this:
Change [YOUR PATH] to your needs.
Code: Select all
$BackupPath = "[YOUR PATH]\XY_<xyver>_<date ddmmyy_hhnnss>.zip";
status "Backup in progress...", "", "progress";
zip_add($BackupPath, <xydata>);
status "Backup to ""$BackupPath"" done", "", "ready";
Re: save application folder in a zip
yuyu thanks a lot
but when I launch the script it complains that some characters are not allowed to be compressed.
if I use 7zip to zip the same folder no complain?!?
Claude
but when I launch the script it complains that some characters are not allowed to be compressed.
if I use 7zip to zip the same folder no complain?!?
Claude
- Attachments
-
- 2021-07-14_174529.png (9.76 KiB) Viewed 1125 times
Last edited by calude on 15 Jul 2021 17:15, edited 1 time in total.
Re: save application folder in a zip
The problem is not in the script itself. It seems that native Windows zip utility somehow does not like § symbols. I don't use Session Manager (and that problem characters are generated likely by it). Tried on my system. It compresses without complaints but breaks those symbols in the archive and after decompressing.
§2§_ >>> _2__
Cannot offer the solution yet
§2§_ >>> _2__
Cannot offer the solution yet
Re: save application folder in a zip
It seems you have 7-Zip installed. You could try substituting 7z for zip_add. Something along these lines.
Code: Select all
$BackupPath = "Your Destinaiton Path\XY_<xyver>_<date ddmmyy_hhnnss>.zip";
status "Backup in progress...", "", "progress";
run """Your Path to 7z\7z.exe"" a ""$BackupPath"" ""<xydata>""";
status "Backup to ""$BackupPath"" done", "", "ready";
Last edited by klownboy on 14 Jul 2021 22:18, edited 1 time in total.
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440
Re: save application folder in a zip
Code: Select all
run """Your Path to 7z\7z.exe"" a ""$BackupPath"" ""<xydata>""";
One of my scripts helped you out? Please donate via Paypal
Re: save application folder in a zip
Oops sorry, thanks highend. I'll correct my post so no one is lead down a merry path.
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440
Re: save application folder in a zip
Thanks highend for help with those quotations. Switched to 7z.
Re: save application folder in a zip
To make it more seemless (i.e., without the 7z box flashing on the screen) use "0" for SC run show parameter.
run """Your Path to 7z\7z.exe"" a ""$BackupPath"" ""<xydata>""",,,0;
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440
Re: save application folder in a zip
or
runret()
with a flag of 2 so you have some error checking as wellOne of my scripts helped you out? Please donate via Paypal
Re: save application folder in a zip
A big thank you to all
Claude
Claude