Bulk delete manually scheduled ix-applications snapshots

ericnotthered

Dabbler
Joined
Jan 2, 2023
Messages
15
I am a relatively new Truenas Scale user (a few months). Not knowing at the time that it is a no-no, I created a daily snapshot of the ix-applications folder and replicated this to an external disk. I've since disabled this, but I have about 5K old snapshots that I would like to get rid of.

I've read in several threads that it is dangerous to delete ix-applications snapshots. However, the solutions to delete these seem to be related to those created by docker. I've implemented a cron job to execute "bash /root/bin/truetool -b 14 -sup" daily. This does not affect any of the scheduled ix-applications snapshots.

Can anyone recommend a method to remove these? I have upgraded to bluefin, if that makes any difference.

I'm not sure if it is safe under bluefin to delete these snapshots through the GUI - and if so, in what order would be best (most recent to oldest or vice versa).

One strategy I was wondering about was if it would work to replicate ix-applications to a different dataset without snapshots (is that possible?) then replicate it back.

Anyway, I'm far from an expert at this stage so I'd appreciate any input.
 

morganL

Captain Morgan
Administrator
Moderator
iXsystems
Joined
Mar 10, 2018
Messages
2,694
Setup the snapshot task to be daily with 1 week/month retention.... then they autodelete.


Delete snapshot using a bulk operation. Probably best do to do <100 at a time. Deleting a snapshot requires metadata operations to free the space so there is some work on the pool.

 

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
You can probably write a script for it using zfs list -t snap and xargs with some grep filtering and awk input sanitizer. However, you'd have to really test it out to ensure you're not going to accidentally delete wrong snapshots.
 
Top