A better Vault backup script to remove old backups

A better Vault backup script to remove old backups

ThomasRambach
Advisor Advisor
2,282 Views
1 Reply
Message 1 of 2

A better Vault backup script to remove old backups

ThomasRambach
Advisor
Advisor

I just wanted to share the Vault backup script I've been using to backup the Vault daily. The script allows you to set the number of backups to save and it will delete the oldest beyond the number of backups you want saved.

 

{BackupFolder} : Set to your Vault backup location (3 locations in the script)

{Username} : Set to the Vault username

{Password} : Set to the Vault users password

skip=2 : This is set to save 3 backups. The 2 in the folder and the backup that will run with the script. Set this to at least 1.

 

 

@ECHO OFF

REM ---- Vault Daily Backup ----

    setlocal enableextensions disabledelayedexpansion

    pushd "{BackupFolder}" && (
        for /f "skip=2 delims=" %%a in (
            'dir /b /ad /tc /o-d'
        ) do rmdir /s /q "%%~fa"
        popd
    )

REM -- Backup Vault ---

"C:\Program Files\Autodesk\ADMS Professional 2019\ADMS Console\Connectivity.ADMSConsole.exe" -Obackup -B"{BackUpFolder}" -VU"{Username}" -VP"{Password}" -DBSC -S -L"{BackUpFolder}\Vault_Backup_Log.txt"
2,283 Views
1 Reply
Reply (1)
Message 2 of 2

RolfEven
Enthusiast
Enthusiast

Thank you for sharing this.

Best regards,

/Rolf Even