Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Mar 2014 23:23:03 +0100 (CET)
From:      Claudius Herder <claudius.herder@ambtec.de>
To:        FreeBSD-gnats-submit@freebsd.org
Cc:        michael@ranner.eu
Subject:   ports/187643: [PATCH] sysutils/duply: add periodic script
Message-ID:  <20140316222303.93E484C85@server.ambtec.de>
Resent-Message-ID: <201403162230.s2GMU0AU008511@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         187643
>Category:       ports
>Synopsis:       [PATCH] sysutils/duply: add periodic script
>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 Mar 16 22:30:00 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     Claudius Herder <claudius.herder@ambtec.de>
>Release:        FreeBSD 10.0-RELEASE amd64
>Organization:
>Environment:
System: FreeBSD server.ambtec.de 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r263203: Sat Mar 15 10:48:26 CET
>Description:
 add script to run duply from periodic(8)

Port maintainer (michael@ranner.eu) is cc'd.

Generated with FreeBSD Port Tools 1.00.2014.03.11 (mode: change, diff: suffix)
>How-To-Repeat:
>Fix:

--- duply-1.6.0.patch begins here ---
diff -ruN ../duply.orig/Makefile ./Makefile
--- ../duply.orig/Makefile	2014-03-16 22:34:11.645356601 +0100
+++ ./Makefile	2014-03-16 22:52:01.597750480 +0100
@@ -16,18 +16,24 @@
 LICENSE_FILE=	${WRKSRC}/gpl-2.0.txt
 
 RUN_DEPENDS=	duplicity:${PORTSDIR}/sysutils/duplicity \
-				bash:${PORTSDIR}/shells/bash
+		bash:${PORTSDIR}/shells/bash
 
 NO_BUILD=	yes
 
 PORTDOCS=	INSTALL.txt gpl-2.0.txt
-PLIST_FILES=	bin/duply
+PLIST_FILES=	bin/duply ${PERIODICDIR}/${PERIODICFILE}
+PLIST_DIRS=	etc/periodic ${PERIODICDIR}
+PERIODICFILE?=	300.duply
+PERIODICDIR?=	${PREFIX}/etc/periodic/backup
+SUB_FILES=	pkg-message periodic_duply
 
 post-patch:
 	${REINPLACE_CMD} -e "s,/etc/duply,${ETCDIR},g" ${WRKSRC}/duply
 
 do-install:
 	${INSTALL_SCRIPT} ${WRKSRC}/duply ${STAGEDIR}${PREFIX}/bin/duply
+	@${MKDIR} ${STAGEDIR}${PERIODICDIR}
+	${INSTALL_SCRIPT} ${WRKDIR}/periodic_duply ${STAGEDIR}${PERIODICDIR}/${PERIODICFILE}
 	@${MKDIR} ${STAGEDIR}${DOCSDIR}
 .	for i in ${PORTDOCS}
 	  ${INSTALL_DATA} ${WRKSRC}/${i} ${STAGEDIR}${DOCSDIR}
diff -ruN ../duply.orig/files/periodic_duply.in ./files/periodic_duply.in
--- ../duply.orig/files/periodic_duply.in	1970-01-01 01:00:00.000000000 +0100
+++ ./files/periodic_duply.in	2014-03-16 22:52:08.752803008 +0100
@@ -0,0 +1,57 @@
+#!/bin/sh
+#
+# periodic(8) script that runs duply on a nightly basis
+#
+# Define these variables in either /etc/periodic.conf or
+# /etc/periodic.conf.local to override the defaults.
+#
+# Configuration Settings (with default values):
+#
+# backup_duply_enable="NO"
+#	enable duply backup
+#
+# backup_duply_profile=""
+#	default duply profile to use
+#	see duply usage
+#
+# backup_duply_command="bkp_status"
+#	default duply commands
+#
+# backup_duply_opt=""
+#	options passed to duply
+#
+# backup_duply_random="0"
+#	randomize backup time
+#
+
+if [ -r /etc/defaults/periodic.conf ]
+then
+    . /etc/defaults/periodic.conf
+    source_periodic_confs
+fi
+
+: ${backup_duply_enable}="NO"
+: ${backup_duply_command}="bkp_status"
+: ${backup_duply_profile}=""
+: ${backup_duply_opt}=""
+: ${backup_duply_random}="0"
+
+PATH=/bin:/sbin:/usr/bin:/usr/sbin:%%LOCALBASE%%/bin:%%LOCALBASE%%/sbin
+export PATH
+
+case "$backup_duply_enable" in
+    [Yy][Ee][Ss])
+	eval sleep $(jot -r 1 0 ${backup_duply_random})
+	echo
+        echo "Duply Backup:"
+        eval duply ${backup_duply_profile} ${backup_duply_command} ${backup_duply_opt}
+        if [ $? -gt 0 ]
+        then
+            echo "Errors were reported during backup."
+            rc=3
+        fi
+        ;;
+esac
+
+exit $rc
+
diff -ruN ../duply.orig/files/pkg-message.in ./files/pkg-message.in
--- ../duply.orig/files/pkg-message.in	1970-01-01 01:00:00.000000000 +0100
+++ ./files/pkg-message.in	2014-03-16 22:52:08.752803008 +0100
@@ -0,0 +1,25 @@
+
+	To run duply periodically you can add these options to your
+	/etc/periodic.conf or /etc/periodic.conf.local
+
+         Configuration Settings (with default values):
+        
+         backup_duply_enable="NO"
+        	enable duply backup
+        
+         backup_duply_profile=""
+        	default duply profile to use
+        	see duply usage
+        
+         backup_duply_command="bkp_status"
+        	default duply commands
+        
+         backup_duply_opt=""
+        	options passed to duply
+        
+         backup_duply_random="0"
+        	randomize backup time
+        
+
+	Add these lines to your /etc/crontab
+	10	3	*	*	*	root	periodic backup
diff -ruN ../duply.orig/pkg-descr ./pkg-descr
--- ../duply.orig/pkg-descr	2014-03-16 22:34:11.645356601 +0100
+++ ./pkg-descr	2014-03-16 17:29:18.688540000 +0100
@@ -3,4 +3,4 @@
 job profiles, batch commands and more. Who says secure
 backups on non-trusted spaces are no child's play. 
 
-WWW:	http://duply.net
+WWW: http://duply.net
--- duply-1.6.0.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140316222303.93E484C85>