Create backups of your tests with simple powershell and Win scheduler

If You want to create backup of your tests You can create powershell script and run it through windows scheduler. To do this create file in notepad++ or similar and paste:

Remove-Item D:\backups\KatalonTestSOld.zip
Rename-Item D:\backups\KatalonTestSNew.zip D:\backups\KatalonTestSOld.zip
Compress-Archive -Path D:\Tools\KatalonTests -DestinationPath D:\backups\KatalonTestSNew.zip

of course change paths accordingly to what You have.
tip: if You want to use network storage path would start with \\ i.e. \\10.10.123.123\KatalonTests

Then, save this file with ps1 extesion and add task in window scheduler to run it how often You want it.
Can’t help with window scheduler cause i have Polish language in OS but You wlil easily find it in google.

When You first run the script it’s show error because this files (“KatalonTestSOld.zip” and “KatalonTestSNew.zip”) don’t exist. So to overcome this problem create zip files and name them “KatalonTestSOld.zip” and “KatalonTestSNew.zip”. It’s just for first run.

2 Likes