Maintaining backup retention policy w/ wimlib?

Comments, questions, bug reports, etc.
Post Reply
Hakkvild Yashnag-Slayer
Posts: 3
Joined: Sun Feb 17, 2019 1:59 pm

Maintaining backup retention policy w/ wimlib?

Post by Hakkvild Yashnag-Slayer »

Hello,

what I'd like to do it to establish some kind of retention policy for the backup chain w/ wimlib since it can do incremental backups, delete images and rebuild the WIM archive. I guess on Windows, it could be done with some one-line script in PowerShell or a batch file. Unfortunately, I can't seem to get my head wrapped around PowerShell so if you could please suggest such a one-liner or a script which does the following:

Step #1: The actual backup, I'm using this command:

Code: Select all

./wimappend.cmd C:\ E:\Backups\wimlib\wimlib-win10.wim --create --update-of=-1 --check --wimboot --snapshot
Step #2: Check how many images are there in the WIM archive w/ wiminfo.
Step #3: If there are more than, say, 2 images; delete the oldest image w/ wimdelete

This way, I would always have 2 recent points in time from which I can perform OS recovery or restore.

Thank you.
Post Reply