Closed RJ-Make closed 2 years ago
Hi there,
Please let me know what the names of the vms you are backing are, and the full string you are using to run the script.
Sorry for the delay.
Here is the requested info.
VM Name: NextCloud_G2
Batch-file Contents: REM Hyper-V Virtual Machine Backup set WorkingDir=G:\Hyper-V_BU_WrkDir set BackUpTheseVMs=C:\FTPSyncFiles\Bat_Files\VM_BU_SCRIPTS\hosts.txt set BackupLocation=A:\ServerFolders\Acronis_Comp_BU\NextCloud_VM\BU\GEN_2 set BackupLogLocation=A:\ServerFolders\Acronis_Comp_BU\NextCloud_VM\BU\Logs set PowerShellScriptLoc=C:\FTPSyncFiles\Bat_Files\VM_BU_SCRIPTS\VMStartStop.ps1
PowerShell -ep bypass %PowerShellScriptLoc% -BackupTo %BackupLocation% -List %BackUpTheseVMs% -Wd %WorkingDir% -Keep 3 -Compress -L %BackupLogLocation%
Hey there, sorry for the wait - I've been testing and tweaking the script. Unfortunately, I can't replicate the issue.
The script deletes old backups based off the CreationTime reported, so perhaps something is changing that, or it's not being recorded properly?
I have updated the script so it reports what files it will delete. Hopefully this will help with finding the problem on your end.
Thank You for all your hard work on this, I will update today and report back.
Running into some problems using the lastest version.
`At C:\FTPSyncFiles\Bat_Files\VM_BU_SCRIPTS\VMStartStop.ps1:1217 char:28
Hi there, Sorry about that!
If you download the most recent version (I updated last night) it should work without those errors you posted.
Perhaps I'm doing something wrong, as I'm getting the same errors.
Here is the new scripts I copied just now. VMStartStop.zip
Just found the issue - there is a difference in the encoding of the script that you have. Did you copy & paste it from github into a txt file? If so, that's where the issue is coming from.
If you download as a zip from GutHub (under the Green "Code" button) then you'll get the script without the encoding issue.
Sorry for the delay,
That was it. Thank You! I'll report back on the deletion issue now that you solved my stupidity.. :-)
No problem at all!
I've been looking at the script today and believe I have fixed the issue you were having, so please check out the latest version: 21.11.05
It appears your prev. version was indeed cleaning up the old back ups. I have downloaded (correctly this time :-) ) this new version and will test and report back.
Latest version has solved the removal of old backup's.
Thanks again for all your hard work.
No problem, glad your problem is fixed! Thanks again
OS: Windows 10 Pro
Problem: Old Backup Files are not being removed. I do see "2021-10-16 01:09:00 [INFO] Removing compressed backups of NextCloud_G2 older than: 3 days" in the logs.
What debug info do you need?