Remove old replicated snapshots from remote server

Status
Not open for further replies.

martijn

Dabbler
Joined
Jun 10, 2011
Messages
13
Im searching for a way to remove old replicated snapshots from a remote server.

Now i have to manually remove snapshots from the server. I don't like to do this, especially if im on vacation ;P
Is there a Python script that i can use as a cronjob to do this?

The script should check the number of snapshots on datasets.
If a dataset has more then 10 snapshots. lets say 16 snapshots then the script removes snapshot 11 to 16.
But only the auto created snapshots, like "tank/vm/metabackup@auto-20120712.1330-2w"

Example usage:
/path/to/autosnapdestroy.py -dataset=tank/data
/path/to/autosnapdestroy.py -dataset=tank/data -keepnumsnapshots=10

If there is no script like this one i will try to create it myself.
Im a PHP scripter so Python should be to hard... (i think)

p.s.

I just looked at /usr/local/www/freenasUI/tools/autosnap.py.
It makes me realise that i have to learn Python first :D
 
Status
Not open for further replies.
Top