Bug 187643 - [PATCH] sysutils/duply: add periodic script
Summary: [PATCH] sysutils/duply: add periodic script
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Pawel Pekala
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-16 22:30 UTC by Claudius Herder
Modified: 2014-03-24 20:40 UTC (History)
1 user (show)

See Also:


Attachments
duply-1.6.0.patch (3.70 KB, patch)
2014-03-16 22:30 UTC, Claudius Herder
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Claudius Herder 2014-03-16 22:30:00 UTC
 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)
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2014-03-16 22:30:05 UTC
Maintainer of sysutils/duply,

Please note that PR ports/187643 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/187643

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2014-03-16 22:30:06 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 michael 2014-03-17 09:19:36 UTC
Approved!

-- 
Mit freundlichen Grüßen

Ing. Michael Ranner

GSM:  +43 676 4155044
Mail: michael@ranner.eu
WWW:  http://www.azedo.at/
Comment 4 Mark Linimon freebsd_committer freebsd_triage 2014-03-17 16:20:28 UTC
State Changed
From-To: feedback->open

Maintainer approved.
Comment 5 Pawel Pekala freebsd_committer freebsd_triage 2014-03-24 20:10:16 UTC
Responsible Changed
From-To: freebsd-ports-bugs->pawel

I'll take it.
Comment 6 dfilter service freebsd_committer freebsd_triage 2014-03-24 20:30:25 UTC
Author: pawel
Date: Mon Mar 24 20:30:21 2014
New Revision: 349065
URL: http://svnweb.freebsd.org/changeset/ports/349065
QAT: https://qat.redports.org/buildarchive/r349065/

Log:
  Add periodic script
  
  PR:		ports/187643
  Submitted by:	Claudius Herder <claudius.herder@ambtec.de>
  Approved by:	maintainer

Added:
  head/sysutils/duply/files/
  head/sysutils/duply/files/periodic_duply.in   (contents, props changed)
  head/sysutils/duply/files/pkg-message.in   (contents, props changed)
Modified:
  head/sysutils/duply/Makefile
  head/sysutils/duply/pkg-descr

Modified: head/sysutils/duply/Makefile
==============================================================================
--- head/sysutils/duply/Makefile	Mon Mar 24 20:30:00 2014	(r349064)
+++ head/sysutils/duply/Makefile	Mon Mar 24 20:30:21 2014	(r349065)
@@ -3,7 +3,7 @@
 
 PORTNAME=	duply
 PORTVERSION=	1.6.0
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	sysutils
 MASTER_SITES=	SF/ftplicity/${PORTNAME}%20%28simple%20duplicity%29/1.6.x/
 DISTNAME=	${PORTNAME}_${PORTVERSION}
@@ -16,18 +16,24 @@ LICENSE=	GPLv2
 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_DIRSTRY=	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}

Added: head/sysutils/duply/files/periodic_duply.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/duply/files/periodic_duply.in	Mon Mar 24 20:30:21 2014	(r349065)
@@ -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
+

Added: head/sysutils/duply/files/pkg-message.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/duply/files/pkg-message.in	Mon Mar 24 20:30:21 2014	(r349065)
@@ -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

Modified: head/sysutils/duply/pkg-descr
==============================================================================
--- head/sysutils/duply/pkg-descr	Mon Mar 24 20:30:00 2014	(r349064)
+++ head/sysutils/duply/pkg-descr	Mon Mar 24 20:30:21 2014	(r349065)
@@ -3,4 +3,4 @@ It greatly simplifies its usage by imple
 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
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 7 Pawel Pekala freebsd_committer freebsd_triage 2014-03-24 20:30:39 UTC
State Changed
From-To: open->closed

Committed. Thanks!