It's easy if you use a chronologically sortable naming scheme. We use YYYY-MM-DD-hhmmss. This is a modified excerpt from the bash script I use. The prune function takes an arg of the number of snapshots to keep. SNAPROOT=/grfs/ud00/.snapshots function prune () { PCPY=$1 for s in $(/bin/ls -d "$SNAPROOT"/????-??-??-?????? | head --lines=-$PCPY); do mmdelsnapshot $FSNAME $s if [ $? != 0 ]; then echo ERROR: there was a mmdelsnapshot problem $? exit else echo Success fi done } echo Pruning snapshots prune 12 -Eric On Wed, Feb 6, 2013 at 10:38 AM, Stuart Barkley <stuartb@4gh.net> wrote:
I'm new on this list. It looks like it can be useful for exchanging GPFS experiences.
We have been running GPFS for a couple of years now on one cluster and are in process of bringing it up on a couple of other clusters.
One thing we would like, but have not had time to do is automatic snapshots similar to what NetApp does. For our purposes a cron job that ran every 4 hours that creates a new snapshot and removes older snapshots would be sufficient. The slightly hard task is correctly removing the older snapshots.
Does anyone have such a cron script they can share?
Or did I miss something in GPFS that handles automatic snapshots?
Thanks, Stuart Barkley -- I've never been lost; I was once bewildered for three days, but never lost! -- Daniel Boone _______________________________________________ gpfsug-discuss mailing list gpfsug-discuss@gpfsug.org http://gpfsug.org/mailman/listinfo/gpfsug-discuss
