Date: Sun, 6 Jul 2008 18:08:52 GMT From: Marcin Simonides <marcin@studio4plus.com> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/125340: New port: sysutils/zfs-snapshot-mgmt Message-ID: <200807061808.m66I8q8Z047774@www.freebsd.org> Resent-Message-ID: <200807061810.m66IA4nC012381@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 125340 >Category: ports >Synopsis: New port: sysutils/zfs-snapshot-mgmt >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Jul 06 18:10:04 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Marcin Simonides >Release: 7-STABLE >Organization: >Environment: >Description: New port: sysutils/zfs-snapshot-mgmt A simple script for automatical ZFS snapshot creation and removal of stale ones. It's the first port of this kind (basically a script and a manpage) I've ever made so please let me know if you have any suggestions for improving it. >How-To-Repeat: >Fix: # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # zfs-snapshot-mgmt # zfs-snapshot-mgmt/pkg-deinstall # zfs-snapshot-mgmt/Makefile # zfs-snapshot-mgmt/pkg-descr # zfs-snapshot-mgmt/distinfo # zfs-snapshot-mgmt/pkg-plist # zfs-snapshot-mgmt/pkg-message # echo c - zfs-snapshot-mgmt mkdir -p zfs-snapshot-mgmt > /dev/null 2>&1 echo x - zfs-snapshot-mgmt/pkg-deinstall sed 's/^X//' >zfs-snapshot-mgmt/pkg-deinstall << '97b38ae3a0ca71730d67c3df1282f76d' X#!/bin/sh X# $FreeBSD$ X# X Xif [ "$2" != "POST-DEINSTALL" ]; then X exit 0 Xfi X Xecho Xecho "Remember to remove zfs-snapshot-mgmt entry from cron configuration." Xecho -n "Otherwise the system will be constantly trying to call the deinstalled" Xecho " script." 97b38ae3a0ca71730d67c3df1282f76d echo x - zfs-snapshot-mgmt/Makefile sed 's/^X//' >zfs-snapshot-mgmt/Makefile << 'a8501ef244177f9cc1644cdedcf531a2' X# New ports collection makefile for: zfs-snapshot-mgmt X# Date created: 6 July 2008 X# Whom: Marcin Simonides <marcin@studio4plus.com> X# X# $FreeBSD$ X# X XPORTNAME= zfs-snapshot-mgmt XPORTVERSION= 20080706 XCATEGORIES= sysutils XMASTER_SITES= http://marcin.studio4plus.com/files/ X XMAINTAINER= marcin@studio4plus.com XCOMMENT= Automatic ZFS snapshot management tool X XRUN_DEPENDS= ruby:${PORTSDIR}/lang/ruby18 X XNO_BUILD= yes XMAN8= zfs-snapshot-mgmt.8 X Xdo-install: X @${INSTALL_SCRIPT} ${WRKSRC}/${PORTNAME} ${PREFIX}/bin X @${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.8 ${MANPREFIX}/man/man8 X @${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.conf.sample ${PREFIX}/etc X Xpost-install: X @${CAT} ${PKGMESSAGE} X X.include <bsd.port.mk> a8501ef244177f9cc1644cdedcf531a2 echo x - zfs-snapshot-mgmt/pkg-descr sed 's/^X//' >zfs-snapshot-mgmt/pkg-descr << '62ac6bc5d18cdd10bae8b97d418c55fb' XA simple ruby script for automating creation and removal of ZFS snapshots. X XWWW: http://marcin.studio4plus.com/zfs-file-history/howto.html 62ac6bc5d18cdd10bae8b97d418c55fb echo x - zfs-snapshot-mgmt/distinfo sed 's/^X//' >zfs-snapshot-mgmt/distinfo << '0afffde509f23f945cf968590d5e81f4' XMD5 (zfs-snapshot-mgmt-20080706.tar.gz) = dfba7b53d8f78cd64fd8a63682f94907 XSHA256 (zfs-snapshot-mgmt-20080706.tar.gz) = 9fed502a115f43652b3e70d801f716a3f18201d1debffd0f65316aae160b8646 XSIZE (zfs-snapshot-mgmt-20080706.tar.gz) = 4515 0afffde509f23f945cf968590d5e81f4 echo x - zfs-snapshot-mgmt/pkg-plist sed 's/^X//' >zfs-snapshot-mgmt/pkg-plist << '741cf0e1185f0799ddf107defb0421d1' Xbin/zfs-snapshot-mgmt Xetc/zfs-snapshot-mgmt.conf.sample X 741cf0e1185f0799ddf107defb0421d1 echo x - zfs-snapshot-mgmt/pkg-message sed 's/^X//' >zfs-snapshot-mgmt/pkg-message << '4a1ce7711dbbf5439b013a28c124d9dd' X XTo actually turn on the automatic snapshots you have to do the following: X X1. Create and customise the configuration file: X X cd /usr/local/etc X cp zfs-snapshot-mgmt.conf.sample zfs-snapshot-mgmt.conf X $EDITOR zfs-snapshot-mgmt.conf X X2. Add an appropriate crontab entry, e.g.: X X echo "*/5 * * * * root /usr/local/bin/zfs-snapshot-mgmt" >> /etc/crontab X XSee zfs-snapshot-mgmt(8) manpage for more details. 4a1ce7711dbbf5439b013a28c124d9dd exit >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200807061808.m66I8q8Z047774>