- Update to 1.9.1

PR:		ports/153934
Submitted by:	Aldis Berjoza <aldis@bsdroot.lv> (maintainer)
Feature safe:	yes
This commit is contained in:
Tim Bishop 2011-01-13 11:53:18 +00:00
parent df494e183c
commit d4d89e4f82
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=267742
4 changed files with 91 additions and 7 deletions

View file

@ -6,7 +6,7 @@
#
PORTNAME= zfsnap
PORTVERSION= 1.8.2
PORTVERSION= 1.9.1
CATEGORIES= sysutils
MASTER_SITES= http://files.bsdroot.lv/my/FreeBSD/distfiles/
DISTNAME= zfSnap-${PORTVERSION}
@ -14,13 +14,32 @@ DISTNAME= zfSnap-${PORTVERSION}
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= 97120372a8b2
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>

View file

@ -1,2 +1,2 @@
SHA256 (zfSnap-1.8.2.tar.gz) = d67398b4d24f1e48f7121e774a3aa3812dfd08456a28a4926946df87c5388672
SIZE (zfSnap-1.8.2.tar.gz) = 3843
SHA256 (zfSnap-1.9.1.tar.gz) = aaa92147d4c6e1b0f2e76edab8822a96ed041ae41869d896a819f170d7c4476b
SIZE (zfSnap-1.9.1.tar.gz) = 4705

View file

@ -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

15
sysutils/zfsnap/pkg-plist Normal file
View file

@ -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%%