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
-
calude
- Posts: 355
- Joined: 13 Aug 2008 10:16
- Location: Switzerland
- Contact:
-
yuyu
- Posts: 154
- Joined: 19 Jun 2018 12:40
- Location: Win 7 x64 - 100%
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";
-
calude
- Posts: 355
- Joined: 13 Aug 2008 10:16
- Location: Switzerland
- Contact:
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
To see the attached files, you need to log into the forum.
Last edited by calude on 15 Jul 2021 17:15, edited 1 time in total.
-
yuyu
- Posts: 154
- Joined: 19 Jun 2018 12:40
- Location: Win 7 x64 - 100%
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
-
klownboy
- Posts: 4459
- Joined: 28 Feb 2012 19:27
- Location: Windows 11, 25H2 Build 26200.8037 at 100% 2560x1440
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.
-
highend
- Posts: 14926
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
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
-
klownboy
- Posts: 4459
- Joined: 28 Feb 2012 19:27
- Location: Windows 11, 25H2 Build 26200.8037 at 100% 2560x1440
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.
-
yuyu
- Posts: 154
- Joined: 19 Jun 2018 12:40
- Location: Win 7 x64 - 100%
Re: save application folder in a zip
Thanks highend for help with those quotations. Switched to 7z.
-
klownboy
- Posts: 4459
- Joined: 28 Feb 2012 19:27
- Location: Windows 11, 25H2 Build 26200.8037 at 100% 2560x1440
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;-
highend
- Posts: 14926
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
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
-
calude
- Posts: 355
- Joined: 13 Aug 2008 10:16
- Location: Switzerland
- Contact:
Re: save application folder in a zip
A big thank you to all
Claude
Claude
XYplorer Beta Club