diff options
author | Pawel Pekala <pawel@FreeBSD.org> | 2014-03-24 20:30:21 +0000 |
---|---|---|
committer | Pawel Pekala <pawel@FreeBSD.org> | 2014-03-24 20:30:21 +0000 |
commit | 463a3f4c41d7c9b351df4bd8355f54201b23e891 (patch) | |
tree | 50fe354f56c37f03e464b920df6b044c970e35a4 /sysutils/duply | |
parent | d34d662a2962b84188664d4e92455bc88f33f68f (diff) | |
download | ports-463a3f4c41d7c9b351df4bd8355f54201b23e891.tar.gz ports-463a3f4c41d7c9b351df4bd8355f54201b23e891.zip |
Add periodic script
PR: ports/187643
Submitted by: Claudius Herder <claudius.herder@ambtec.de>
Approved by: maintainer
Notes
Notes:
svn path=/head/; revision=349065
Diffstat (limited to 'sysutils/duply')
-rw-r--r-- | sysutils/duply/Makefile | 12 | ||||
-rw-r--r-- | sysutils/duply/files/periodic_duply.in | 57 | ||||
-rw-r--r-- | sysutils/duply/files/pkg-message.in | 25 | ||||
-rw-r--r-- | sysutils/duply/pkg-descr | 2 |
4 files changed, 92 insertions, 4 deletions
diff --git a/sysutils/duply/Makefile b/sysutils/duply/Makefile index 59bff4579883..843b4fb7855e 100644 --- a/sysutils/duply/Makefile +++ b/sysutils/duply/Makefile @@ -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} diff --git a/sysutils/duply/files/periodic_duply.in b/sysutils/duply/files/periodic_duply.in new file mode 100644 index 000000000000..a35461463e3a --- /dev/null +++ b/sysutils/duply/files/periodic_duply.in @@ -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 --git a/sysutils/duply/files/pkg-message.in b/sysutils/duply/files/pkg-message.in new file mode 100644 index 000000000000..0f0ff8e280f5 --- /dev/null +++ b/sysutils/duply/files/pkg-message.in @@ -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 --git a/sysutils/duply/pkg-descr b/sysutils/duply/pkg-descr index 9ba0bbb6fad3..099adbcdefb6 100644 --- a/sysutils/duply/pkg-descr +++ b/sysutils/duply/pkg-descr @@ -3,4 +3,4 @@ It greatly simplifies its usage by implementing backup 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 |