On Fri, Mar 07, 2008 at 01:52:45AM -0500, Rob Logan wrote:
>  > Because then I have to compute yesterday's date to do the  
>  > incremental dump.
> 
> snaps=15
> today=`date +%j`
> # to change the second day of the year from 002 to 2
> today=`expr $today + 0`

Er, can't this be confused with octal?  Hmm, guess not.

> nuke=`expr $today - $snaps`
> yesterday=`expr $today - 1`
> 
> if [ $yesterday -lt 1 ] ; then
>    yesterday=365
> fi

Er, what if the year before was a leap year?

Anyways, yes, you can keep symlinks to snapshots
(.zfs/snapshot/<snapshot-name>).

Also, you don't have to compute yesterday's date.  You can just have a
convention for naming these snapshots and do this:

yesterday's snapshot name = zfs list -r <dataset>|grep <convention>|head -1

create today's snapshot

delete yesterday's.
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to