[Midnightbsd-cvs] mports [15445] trunk/sysutils: zfs-stats, zfsnap and zfstools make working with zfs much easier.

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sun Sep 15 21:53:34 EDT 2013


Revision: 15445
          http://svnweb.midnightbsd.org/mports/?rev=15445
Author:   laffer1
Date:     2013-09-15 21:53:32 -0400 (Sun, 15 Sep 2013)
Log Message:
-----------
zfs-stats, zfsnap and zfstools make working with zfs much easier.

Modified Paths:
--------------
    trunk/sysutils/Makefile

Added Paths:
-----------
    trunk/sysutils/zfs-stats/
    trunk/sysutils/zfs-stats/Makefile
    trunk/sysutils/zfs-stats/distinfo
    trunk/sysutils/zfs-stats/pkg-descr
    trunk/sysutils/zfsnap/
    trunk/sysutils/zfsnap/Makefile
    trunk/sysutils/zfsnap/distinfo
    trunk/sysutils/zfsnap/pkg-descr
    trunk/sysutils/zfsnap/pkg-message
    trunk/sysutils/zfsnap/pkg-plist
    trunk/sysutils/zfstools/
    trunk/sysutils/zfstools/Makefile
    trunk/sysutils/zfstools/distinfo
    trunk/sysutils/zfstools/files/
    trunk/sysutils/zfstools/files/pkg-message.in
    trunk/sysutils/zfstools/pkg-descr
    trunk/sysutils/zfstools/pkg-plist

Modified: trunk/sysutils/Makefile
===================================================================
--- trunk/sysutils/Makefile	2013-09-13 00:00:06 UTC (rev 15444)
+++ trunk/sysutils/Makefile	2013-09-16 01:53:32 UTC (rev 15445)
@@ -112,5 +112,8 @@
 SUBDIR += wmbsdbatt
 SUBDIR += xfce4-settings
 SUBDIR += zeitgeist
+SUBDIR += zfs-stats
+SUBDIR += zfsnap
+SUBDIR += zfstools
 
 .include <bsd.port.subdir.mk>

Added: trunk/sysutils/zfs-stats/Makefile
===================================================================
--- trunk/sysutils/zfs-stats/Makefile	                        (rev 0)
+++ trunk/sysutils/zfs-stats/Makefile	2013-09-16 01:53:32 UTC (rev 15445)
@@ -0,0 +1,28 @@
+# $MidnightBSD$
+# $FreeBSD: head/sysutils/zfs-stats/Makefile 326572 2013-09-07 06:13:27Z az $
+
+PORTNAME=	zfs-stats
+PORTVERSION=	1.2.2
+CATEGORIES=	sysutils
+MASTER_SITES=	http://cloud.github.com/downloads/mmatuska/zfs-stats/
+
+MAINTAINER=	ports at MidnightBSD.org
+COMMENT=	Display human-readable ZFS statistics
+
+LICENSE=	bsd2
+
+USE_PERL5=	yes
+
+NO_BUILD=	yes
+
+PLIST_FILES=	bin/zfs-stats \
+		bin/zfs-mon
+
+post-patch:
+	@${REINPLACE_CMD} -e "s|/usr/bin/env -iS perl|${PERL}|g" ${WRKSRC}/zfs-stats
+
+do-install:
+	${INSTALL_SCRIPT} ${WRKSRC}/zfs-stats ${PREFIX}/bin/zfs-stats
+	${INSTALL_SCRIPT} ${WRKSRC}/zfs-mon ${PREFIX}/bin/zfs-mon
+
+.include <bsd.port.mk>

Added: trunk/sysutils/zfs-stats/distinfo
===================================================================
--- trunk/sysutils/zfs-stats/distinfo	                        (rev 0)
+++ trunk/sysutils/zfs-stats/distinfo	2013-09-16 01:53:32 UTC (rev 15445)
@@ -0,0 +1,2 @@
+SHA256 (zfs-stats-1.2.2.tar.gz) = a04af0ed750edf92356b0e93ca5b6f9d9d3568ae72756b9f84b7b756aea99741
+SIZE (zfs-stats-1.2.2.tar.gz) = 10182

Added: trunk/sysutils/zfs-stats/pkg-descr
===================================================================
--- trunk/sysutils/zfs-stats/pkg-descr	                        (rev 0)
+++ trunk/sysutils/zfs-stats/pkg-descr	2013-09-16 01:53:32 UTC (rev 15445)
@@ -0,0 +1,7 @@
+zfs-stats displays ZFS statistics in human-readable format including
+ARC, L2ARC, zfetch (DMU) and vdev cache statistics.
+
+This script is a fork of Jason J. Hellenthal's <jhell at DataIX.net>
+arc_summary.pl: http://code.google.com/p/jhell/
+
+WWW:	http://www.vx.sk/zfs-stats/

Added: trunk/sysutils/zfsnap/Makefile
===================================================================
--- trunk/sysutils/zfsnap/Makefile	                        (rev 0)
+++ trunk/sysutils/zfsnap/Makefile	2013-09-16 01:53:32 UTC (rev 15445)
@@ -0,0 +1,41 @@
+# $MidnightBSD$
+
+PORTNAME=	zfsnap
+PORTVERSION=	1.11.0
+CATEGORIES=	sysutils
+
+MAINTAINER=	ports at MidnightBSD.org
+COMMENT=	Simple sh script to make zfs rolling snaphosts with cron
+
+LICENSE=	other
+#beerware license
+
+NO_BUILD=	yes
+USE_GITHUB=	yes
+GH_PROJECT=	zfSnap
+GH_ACCOUNT=	graudeejs
+GH_TAGNAME=	v${PORTVERSION}
+GH_COMMIT=	2228749
+
+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 hourly 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
+.for period in hourly daily weekly monthly
+	@${MKDIR} ${PERIODICDIR}/${period}
+	@${INSTALL_SCRIPT} ${WRKSRC}/${period}_zfSnap.sh ${PERIODICDIR}/${period}/402.zfSnap
+	@${INSTALL_SCRIPT} ${WRKSRC}/${period}_zfSnap_delete.sh ${PERIODICDIR}/${period}/403.zfSnap_delete
+.endfor
+	@${MKDIR} ${PERIODICDIR}/reboot
+	@${INSTALL_SCRIPT} ${WRKSRC}/reboot_zfSnap.sh ${PERIODICDIR}/reboot/402.zfSnap
+
+.include <bsd.port.mk>

Added: trunk/sysutils/zfsnap/distinfo
===================================================================
--- trunk/sysutils/zfsnap/distinfo	                        (rev 0)
+++ trunk/sysutils/zfsnap/distinfo	2013-09-16 01:53:32 UTC (rev 15445)
@@ -0,0 +1,2 @@
+SHA256 (zfsnap-1.11.0.tar.gz) = 7e5f59eaf16413179724ace9fbbae5c53caf67f67c3516bf1b85edd4d78558a0
+SIZE (zfsnap-1.11.0.tar.gz) = 4973

Added: trunk/sysutils/zfsnap/pkg-descr
===================================================================
--- trunk/sysutils/zfsnap/pkg-descr	                        (rev 0)
+++ trunk/sysutils/zfsnap/pkg-descr	2013-09-16 01:53:32 UTC (rev 15445)
@@ -0,0 +1,9 @@
+zfSnap is simple sh script to make rolling zfs snapshots with cron. Main
+advantage of zfSnap is that it's written in %100 pure /bin/sh, doesn't
+require any additional software to run, and is simple to use.
+
+zfSnap keeps all information about snapshot in snapshot name. zfs snapshot
+names are in form: Timestamp--TTL where timestamp is date and time of
+snapshot creation and TTL is Time To Live in human readable form.
+
+WWW: https://github.com/graudeejs/zfSnap/

Added: trunk/sysutils/zfsnap/pkg-message
===================================================================
--- trunk/sysutils/zfsnap/pkg-message	                        (rev 0)
+++ trunk/sysutils/zfsnap/pkg-message	2013-09-16 01:53:32 UTC (rev 15445)
@@ -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 periodically
+					     (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 hard-coded
+	(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 https://github.com/graudeejs/zfSnap/wiki for more
+	info.
+
+	Feedback welcomed: graudeejs at gmail.com

Added: trunk/sysutils/zfsnap/pkg-plist
===================================================================
--- trunk/sysutils/zfsnap/pkg-plist	                        (rev 0)
+++ trunk/sysutils/zfsnap/pkg-plist	2013-09-16 01:53:32 UTC (rev 15445)
@@ -0,0 +1,16 @@
+sbin/zfSnap
+%%PERIODICDIR%%/daily/402.zfSnap
+%%PERIODICDIR%%/daily/403.zfSnap_delete
+%%PERIODICDIR%%/hourly/402.zfSnap
+%%PERIODICDIR%%/hourly/403.zfSnap_delete
+%%PERIODICDIR%%/monthly/402.zfSnap
+%%PERIODICDIR%%/monthly/403.zfSnap_delete
+%%PERIODICDIR%%/reboot/402.zfSnap
+%%PERIODICDIR%%/weekly/402.zfSnap
+%%PERIODICDIR%%/weekly/403.zfSnap_delete
+ at dirrmtry %%PERIODICDIR%%/weekly
+ at dirrmtry %%PERIODICDIR%%/reboot
+ at dirrmtry %%PERIODICDIR%%/monthly
+ at dirrmtry %%PERIODICDIR%%/hourly
+ at dirrmtry %%PERIODICDIR%%/daily
+ at dirrmtry %%PERIODICDIR%%

Added: trunk/sysutils/zfstools/Makefile
===================================================================
--- trunk/sysutils/zfstools/Makefile	                        (rev 0)
+++ trunk/sysutils/zfstools/Makefile	2013-09-16 01:53:32 UTC (rev 15445)
@@ -0,0 +1,34 @@
+# $MidnightBSD$
+
+PORTNAME=	zfstools
+PORTVERSION=	0.2.2
+CATEGORIES=	sysutils ruby
+MASTER_SITES=	GH \
+		http://mirror.shatow.net/freebsd/${PORTNAME}/
+
+MAINTAINER=	ports at MidnightBSD.org
+COMMENT=	OpenSolaris-compatible auto snapshotting for ZFS
+
+LICENSE=	bsd2
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	bdrewery
+GH_COMMIT=	924b60c
+GH_TAGNAME=	v${DISTVERSION}
+
+USE_RUBY=	yes
+NO_BUILD=	yes
+
+SUB_FILES=	pkg-message
+
+.include <bsd.mport.options.mk>
+
+do-install:
+	@cd ${WRKSRC}/bin && ${COPYTREE_BIN} . ${PREFIX}/sbin
+	@cd ${WRKSRC}/lib && ${COPYTREE_SHARE} . ${RUBY_SITELIBDIR}
+.if ${PORT_OPTIONS:MDOCS}
+	@${MKDIR} ${DOCSDIR}
+	@${INSTALL_DATA} ${WRKSRC}/README.md ${DOCSDIR}
+.endif
+
+.include <bsd.port.mk>

Added: trunk/sysutils/zfstools/distinfo
===================================================================
--- trunk/sysutils/zfstools/distinfo	                        (rev 0)
+++ trunk/sysutils/zfstools/distinfo	2013-09-16 01:53:32 UTC (rev 15445)
@@ -0,0 +1,2 @@
+SHA256 (zfstools-0.2.2.tar.gz) = 64f6e0c39942b8300a91c82b2674172df437bf76e4b17fe8ab10b1d008e57a22
+SIZE (zfstools-0.2.2.tar.gz) = 10665

Added: trunk/sysutils/zfstools/files/pkg-message.in
===================================================================
--- trunk/sysutils/zfstools/files/pkg-message.in	                        (rev 0)
+++ trunk/sysutils/zfstools/files/pkg-message.in	2013-09-16 01:53:32 UTC (rev 15445)
@@ -0,0 +1,17 @@
+To enable automatic snapshots, place lines such as these into /etc/crontab:
+
+    15,30,45 * * * * root %%PREFIX%%/sbin/zfs-auto-snapshot frequent  4
+    0        * * * * root %%PREFIX%%/sbin/zfs-auto-snapshot hourly   24
+    7        0 * * * root %%PREFIX%%/sbin/zfs-auto-snapshot daily     7
+    14       0 * * 7 root %%PREFIX%%/sbin/zfs-auto-snapshot weekly    4
+    28       0 1 * * root %%PREFIX%%/sbin/zfs-auto-snapshot monthly  12
+
+This will keep 4 15-minutely snapshots, 24 hourly snapshots, 7 daily snapshots,
+4 weekly snapshots and 12 monthly snapshots. Any resulting zero-sized snapshots
+will be automatically cleaned up.
+
+Enable snapshotting on a dataset or top-level pool with:
+
+    zfs set com.sun:auto-snapshot=true DATASET
+
+See website and command usage output for further details.

Added: trunk/sysutils/zfstools/pkg-descr
===================================================================
--- trunk/sysutils/zfstools/pkg-descr	                        (rev 0)
+++ trunk/sysutils/zfstools/pkg-descr	2013-09-16 01:53:32 UTC (rev 15445)
@@ -0,0 +1,4 @@
+ZFSTools is an OpenSolaris-like and compatible auto snapshotting
+script, which also supports auto snapshotting mysql databases.
+
+WWW: http://github.com/bdrewery/zfstools

Added: trunk/sysutils/zfstools/pkg-plist
===================================================================
--- trunk/sysutils/zfstools/pkg-plist	                        (rev 0)
+++ trunk/sysutils/zfstools/pkg-plist	2013-09-16 01:53:32 UTC (rev 15445)
@@ -0,0 +1,13 @@
+%%PORTDOCS%%%%DOCSDIR%%/README.md
+%%RUBY_SITELIBDIR%%/zfstools.rb
+%%RUBY_SITELIBDIR%%/zfstools/dataset.rb
+%%RUBY_SITELIBDIR%%/zfstools/snapshot.rb
+ at dirrm %%RUBY_SITELIBDIR%%/zfstools
+ at dirrmtry %%RUBY_SITELIBDIR%%
+ at dirrmtry lib/ruby/site_ruby
+ at dirrmtry lib/ruby
+%%PORTDOCS%%@dirrm %%DOCSDIR%%
+ at exec /bin/mkdir -p %D/%%RUBY_SITELIBDIR%%/zfstools
+sbin/zfs-auto-snapshot
+sbin/zfs-cleanup-snapshots
+sbin/zfs-snapshot-mysql



More information about the Midnightbsd-cvs mailing list