Date: Wed, 12 Jan 2011 16:47:55 GMT From: Aldis Berjoza <aldis@bsdroot.lv> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/153934: [PATCH] sysutils/zfsnap update to v1.9.0 Message-ID: <201101121647.p0CGltRe003500@red.freebsd.org> Resent-Message-ID: <201101121650.p0CGo63k025079@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 153934 >Category: ports >Synopsis: [PATCH] sysutils/zfsnap update to v1.9.0 >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Wed Jan 12 16:50:06 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Aldis Berjoza >Release: >Organization: >Environment: >Description: Update zfSnap to v1.9.0 What's new: * Added -e switch. When set exitcode will return number of failed actions * Added periodic scripts >How-To-Repeat: >Fix: Patch attached with submission follows: diff -uN zfsnap.bak/Makefile zfsnap/Makefile --- zfsnap.bak/Makefile 2011-01-12 15:48:27.125586351 +0200 +++ zfsnap/Makefile 2011-01-12 18:43:25.302403795 +0200 @@ -6,7 +6,7 @@ # PORTNAME= zfsnap -PORTVERSION= 1.8.2 +PORTVERSION= 1.9.0 CATEGORIES= sysutils MASTER_SITES= http://files.bsdroot.lv/my/FreeBSD/distfiles/ DISTNAME= zfSnap-${PORTVERSION} @@ -14,13 +14,32 @@ MAINTAINER= aldis@bsdroot.lv COMMENT= Simple sh script to make zfs rolling snaphosts with cron -PLIST_FILES= sbin/zfSnap - NO_BUILD= yes WRKSRC= ${WRKDIR}/zfSnap-${REV} -REV= fe4a95a6b271 +REV= e5a03b3a02c8 + +PERIODICDIR?= ${PREFIX}/etc/periodic +PLIST_SUB+= PERIODICDIR="${PERIODICDIR:S,^${PREFIX}/,,}" + +do-patch: +.for period in hourly daily weekly monthly reboot + @${SED} -e "s/xPERIODICx/${period}/g" -e "s#xPREFIXx#${PREFIX}/sbin#g" ${WRKSRC}/xPERIODICx_zfSnap.sh > ${WRKSRC}/${period}_zfSnap.sh +.endfor +.for period in daily weekly monthly + @${SED} -e "s/xPERIODICx/${period}/g" -e "s#xPREFIXx#${PREFIX}/sbin#g" ${WRKSRC}/xPERIODICx_zfSnap_delete.sh > ${WRKSRC}/${period}_zfSnap_delete.sh +.endfor do-install: - ${INSTALL_SCRIPT} ${WRKSRC}/zfSnap.sh ${PREFIX}/sbin/zfSnap + @${INSTALL_SCRIPT} ${WRKSRC}/zfSnap.sh ${PREFIX}/sbin/zfSnap +.for period in hourly daily weekly monthly reboot + @${MKDIR} ${PERIODICDIR}/${period} + @${INSTALL_SCRIPT} ${WRKSRC}/${period}_zfSnap.sh ${PERIODICDIR}/${period}/402.zfSnap +.endfor +.for period in daily weekly monthly + @${INSTALL_SCRIPT} ${WRKSRC}/${period}_zfSnap_delete.sh ${PERIODICDIR}/${period}/403.zfSnap_delete +.endfor + +post-install: + @${CAT} ${PKGMESSAGE} .include <bsd.port.mk> diff -uN zfsnap.bak/distinfo zfsnap/distinfo --- zfsnap.bak/distinfo 2011-01-12 15:48:27.125586351 +0200 +++ zfsnap/distinfo 2011-01-12 18:43:32.586327590 +0200 @@ -1,2 +1,2 @@ -SHA256 (zfSnap-1.8.2.tar.gz) = d67398b4d24f1e48f7121e774a3aa3812dfd08456a28a4926946df87c5388672 -SIZE (zfSnap-1.8.2.tar.gz) = 3843 +SHA256 (zfSnap-1.9.0.tar.gz) = 2d74dd1c59a4b5cff31076e067f32109d1453eb2ad8ff4036ed7427b8ae9355e +SIZE (zfSnap-1.9.0.tar.gz) = 4669 diff -uN zfsnap.bak/pkg-message zfsnap/pkg-message --- zfsnap.bak/pkg-message 1970-01-01 03:00:00.000000000 +0300 +++ zfsnap/pkg-message 2011-01-12 18:40:40.817570108 +0200 @@ -0,0 +1,50 @@ + + To run zfSnap periodically you can add these options to your + /etc/periodic.conf + + xPERIODICx_zfsnap_enable - Enable xPERIODICx snapshots + (values: YES | NO) + xPERIODICx_zfsnap_fs - Space separated zfs filesystems + to create non-recursive snapshots + xPERIODICx_zfsnap_recursive_fs - Space separated zfs filesystems + to create recursive snapshots + xPERIODICx_zfsnap_ttl - Set Time To Live + xPERIODICx_zfsnap_verbose - Verbose output (values: YES | NO) + xPERIODICx_zfsnap_flags - zfSnap generic flags + (except -v and -d) + xPERIODICx_zfsnap_enable_prefix - Create snapshots with prefix + (Default = YES) + xPERIODICx_zfsnap_prefix - Set prefix to use for new snapshots + (Default = "xPERIODICx-") + (where xPERIODICx is any of hourly, daily, weekly, monthly, reboot) + + xPERIODICx_zfsnap_delete_enable - Delete old snapshots periodicaly + (values: YES | NO) + xPERIODICx_zfsnap_delete_flags - zfSnap generic flags + (except -v and -d) + xPERIODICx_zfsnap_delete_verbose - Verbose output (values: YES | NO) + xPERIODICx_zfsnap_delete_prefixes - Space separated list of prefixes + of old zfSnap snapshots to delete + 'hourly-', 'daily-', 'weekly-', + 'monthly-' and 'reboot' prefixes + are hardcoded + (where xPERIODICx is any of daily, weekly, monthly) + + + Add these lines to your /etc/crontab + 4 * * * * root periodic hourly + @reboot root periodic reboot + + NOTE: it is not recommended to delete zfSnap snapshots every hour. + Deleting zfs snapshots takes more time than creating them. + There for it's better to delete snapshots once per day... + + + Periodic scripts provide very limited feature set. If you want to use + more advanced setup, you need to call zfSnap from crontab directly. + This way you can combine all sort of parameter combinations. + + Don't forget to check http://wiki.bsdroot.lv/zfsnap for more info. + + Feedback wellcomed: zfsnap@bsdroot.lv + diff -uN zfsnap.bak/pkg-plist zfsnap/pkg-plist --- zfsnap.bak/pkg-plist 1970-01-01 03:00:00.000000000 +0300 +++ zfsnap/pkg-plist 2011-01-12 18:07:29.828367850 +0200 @@ -0,0 +1,15 @@ +sbin/zfSnap +%%PERIODICDIR%%/daily/402.zfSnap +%%PERIODICDIR%%/daily/403.zfSnap_delete +%%PERIODICDIR%%/hourly/402.zfSnap +%%PERIODICDIR%%/monthly/402.zfSnap +%%PERIODICDIR%%/monthly/403.zfSnap_delete +%%PERIODICDIR%%/reboot/402.zfSnap +%%PERIODICDIR%%/weekly/402.zfSnap +%%PERIODICDIR%%/weekly/403.zfSnap_delete +@dirrmtry %%PERIODICDIR%%/weekly +@dirrmtry %%PERIODICDIR%%/reboot +@dirrmtry %%PERIODICDIR%%/monthly +@dirrmtry %%PERIODICDIR%%/hourly +@dirrmtry %%PERIODICDIR%%/daily +@dirrmtry %%PERIODICDIR%% >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101121647.p0CGltRe003500>