rsnapshot: add rsnapshot backup utility

this adds the rsnapshot backup utility to the packages feed.

To be compatible with busybox logger, I had to patch rsnapshot to don't
pass -i to logger. This package was also proposed in Ticket #11371, but
in a wrong categorie, without this patch, without most of the dependencies
and without the conffiles line to save rsnapshot.conf over sysupgrade.

[florian: fix whitespaces and clean up configure args]

Signed-off-by: Stefan Hellermann <stefan@the2masters.de>
Signed-off-by: Florian Fainelli <florian@openwrt.org>

git-svn-id: svn://svn.openwrt.org/openwrt/packages@34508 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
florian 2012-12-05 17:31:02 +00:00
parent 84ed3b4e75
commit 98989f0e37
2 changed files with 96 additions and 0 deletions

73
utils/rsnapshot/Makefile Normal file
View File

@ -0,0 +1,73 @@
#
# Copyright (C) 2007-2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=rsnapshot
PKG_VERSION:=1.3.1
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.rsnapshot.org/downloads/
PKG_MD5SUM:=588f92995dcf60a6ea6df8d94a017e7e
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
define Package/rsnapshot
SUBMENU:=backup
SECTION:=utils
CATEGORY:=Utilities
TITLE:=rsnapshot Backup
URL:=http://www.rsnapshot.org/
DEPENDS:=+rsync +perl \
+perlbase-autoloader \
+perlbase-class \
+perlbase-cwd \
+perlbase-dirhandle \
+perlbase-essential \
+perlbase-fcntl \
+perlbase-file \
+perlbase-getopt \
+perlbase-io \
+perlbase-posix \
+perlbase-selectsaver \
+perlbase-symbol \
+perlbase-tie \
+perlbase-xsloader
endef
define Package/rsnapshot/description
rsnapshot is a filesystem snapshot utility for making backups of local and
remote systems.
Using rsync and hard links, it is possible to keep multiple, full backups
instantly available. The disk space required is just a little more than the
space of one full backup, plus incrementals.
endef
CONFIGURE_ARGS += --with-cp=/bin/cp \
--with-rsync=/usr/bin/rsync \
--with-rm=/bin/rm \
--with-ssh=/usr/bin/ssh \
--with-logger=/usr/bin/logger \
--with-du=/usr/bin/du
define Package/rsnapshot/install
$(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/
$(INSTALL_DIR) $(1)/etc
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/$(PKG_NAME).conf.default $(1)/etc/$(PKG_NAME).conf
endef
define Package/rsnapshot/conffiles
/etc/$(PKG_NAME).conf
endef
$(eval $(call BuildPackage,rsnapshot))

View File

@ -0,0 +1,23 @@
diff --git a/rsnapshot-program.pl b/rsnapshot-program.pl
index dfd7ef6..c51b9ff 100755
--- a/rsnapshot-program.pl
+++ b/rsnapshot-program.pl
@@ -2164,15 +2164,15 @@ sub syslog_msg {
if (defined($config_vars{'cmd_logger'})) {
# print out our call to syslog
if (defined($verbose) && ($verbose >= 4)) {
- print_cmd("$config_vars{'cmd_logger'} -i -p $facility.$level -t rsnapshot $msg");
+ print_cmd("$config_vars{'cmd_logger'} -p $facility.$level -t rsnapshot $msg");
}
# log to syslog
if (0 == $test) {
- $result = system($config_vars{'cmd_logger'}, '-i', '-p', "$facility.$level", '-t', 'rsnapshot', $msg);
+ $result = system($config_vars{'cmd_logger'}, '-p', "$facility.$level", '-t', 'rsnapshot', $msg);
if (0 != $result) {
print_warn("Could not log to syslog:", 2);
- print_warn("$config_vars{'cmd_logger'} -i -p $facility.$level -t rsnapshot $msg", 2);
+ print_warn("$config_vars{'cmd_logger'} -p $facility.$level -t rsnapshot $msg", 2);
}
}
}