From patchwork Wed Aug 15 05:34:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Fischer X-Patchwork-Id: 1884 Return-Path: Received: from mail01.ipfire.org (mail01.ipfire.org [IPv6:2001:470:7183:25::1]) by web02.i.ipfire.org (Postfix) with ESMTP id 533AC61A23 for ; Tue, 14 Aug 2018 21:34:46 +0200 (CEST) Received: from mail01.i.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id 94C351143585; Tue, 14 Aug 2018 20:34:45 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=201801; t=1534275285; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references:list-id: list-unsubscribe:list-subscribe:list-post; bh=szBsE8oP+byNo1JEbBA39oP2jbzsjGF7DTSrmrvlHBg=; b=xwzAanXEhCbPK81zywKlAQKbwdyP4g5fFbIM6eQrgR053pqm3uG41TUQwg/4q1G1Uvd+Pp YC9nupCOg7zApA9YCdlkB6uqWvfoaRgjKGQ9zV7LbHwDB2Zbvtx8SgdExmjrPS44uxwZYT ltW4MW0jaT+7OZHBVI0hqSkjpmaBXfMsZjB1aGSxYKcFwINSX7OiO78g/ZHoHsLvep8zaY oIHDNhMpHVOPvvl9WPszKOmb55e+4igUrEUGjSDlcmVP+qTLy4kKgUE6CMjTgFBL8UmnIR gZHzE5p1nZQsQpESrZOYRcq4dduLby/bjcSn1s0scw7Ad1wMvC5z/lhYR7gNwg== Received: from Devel.localdomain (p5B0A2AAB.dip0.t-ipconnect.de [91.10.42.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id DA1D01143571 for ; Tue, 14 Aug 2018 20:34:42 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=201801; t=1534275283; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=szBsE8oP+byNo1JEbBA39oP2jbzsjGF7DTSrmrvlHBg=; b=QEg8dJifwqoONCZ1UuJjTO3xdp982yAaPG1WRQdXPAjhXGxUIo/4c5lqYrQXz79fAbVTgt 0llf757/VCwa/6DoyI+F9pbncnAeMDslF39vY8xC5FiToDsMaSbnY7b6A5LMY/sg59KuPD xbF/p9qzH/Q/8boESbjbVDF37wrhgwRv00U7V9mgicfRkxKhpnfr6bSX5l5vtkrah3nY76 ejiSV1lEQX1zBdWutd9MGwInpSVdt3CDXgCQ5W53MzCgxDKSUyu8B3+HOnEIsNJX/8tXvY 4SqCruqFRHBViFqvSSuFC+H9RIbORfzFUATssq5wvmUwRHzsj8pTWfYLDEjsvw== From: Matthias Fischer To: development@lists.ipfire.org Subject: [PATCH] Fixes for 'backup.pl' (Bug #11816) Date: Tue, 14 Aug 2018 21:34:38 +0200 Message-Id: <20180814193438.1961-1-matthias.fischer@ipfire.org> X-Mailer: git-send-email 2.18.0 Authentication-Results: mail01.ipfire.org; auth=pass smtp.auth=mfischer smtp.mailfrom=matthias.fischer@ipfire.org X-Spamd-Result: default: False [-1.70 / 11.00]; ARC_NA(0.00)[]; URL_IN_SUBJECT(0.40)[backup.pl]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; DKIM_SIGNED(0.00)[]; MID_CONTAINS_FROM(1.00)[]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:3320, ipnet:91.0.0.0/10, country:DE]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] X-Spam-Status: No, score=-1.70 X-Rspamd-Server: mail01.i.ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Hi, Fixes #11816 (https://bugzilla.ipfire.org/show_bug.cgi?id=11816 and https://bugzilla.ipfire.org/attachment.cgi?id=608): "[root@ipfire ~]# backupctrl exclude ... tar: The following options were used after any non-optional arguments in archive create or update mode. These options are positional and affect only arguments that follow them. Please, rearrange them properly. tar: --exclude-from '/var/ipfire/backup/exclude.user' has no effect tar: Exiting with failure status due to previous errors" Please test - I got no errors anymore. Best, Matthias Signed-off-by: Matthias Fischer --- config/backup/backup.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/backup/backup.pl b/config/backup/backup.pl index d430f3467..ce16e7f42 100644 --- a/config/backup/backup.pl +++ b/config/backup/backup.pl @@ -46,7 +46,7 @@ if (($ARGV[0] eq 'include') || ($ARGV[0] eq 'iso')) { print DATEI @include; print "/var/log/messages"; close(DATEI); - system("tar -cvzf /var/ipfire/backup/$Jahr$Monat$Monatstag-$Stunden$Minuten.ipf --files-from='/tmp/include' --exclude-from='/var/ipfire/backup/exclude' --files-from='/var/ipfire/backup/include.user' --exclude-from='/var/ipfire/backup/exclude.user'"); + system("tar -cvzf /var/ipfire/backup/$Jahr$Monat$Monatstag-$Stunden$Minuten.ipf --exclude-from='/var/ipfire/backup/exclude' --exclude-from='/var/ipfire/backup/exclude.user' --files-from='/tmp/include' --files-from='/var/ipfire/backup/include.user'"); system("rm /tmp/include"); if ($ARGV[0] eq 'iso') { system("/usr/local/bin/backupiso $Jahr$Monat$Monatstag-$Stunden$Minuten &"); @@ -57,7 +57,7 @@ elsif ($ARGV[0] eq 'exclude') { open(DATEI, ">/tmp/include") || die "Could not save temp include file"; print DATEI @include; close(DATEI); - system("tar -cvzf /var/ipfire/backup/$Jahr$Monat$Monatstag-$Stunden$Minuten.ipf --files-from='/tmp/include' --exclude-from='/var/ipfire/backup/exclude' --files-from='/var/ipfire/backup/include.user' --exclude-from='/var/ipfire/backup/exclude.user'"); + system("tar -cvzf /var/ipfire/backup/$Jahr$Monat$Monatstag-$Stunden$Minuten.ipf --exclude-from='/var/ipfire/backup/exclude' --exclude-from='/var/ipfire/backup/exclude.user' --files-from='/tmp/include' --files-from='/var/ipfire/backup/include.user'"); system("rm /tmp/include"); } elsif ($ARGV[0] eq 'restore') { @@ -158,7 +158,7 @@ sub createinclude(){ open(DATEI, "<${General::swroot}/backup/include") || die "Can not open include file"; my @Zeilen = ; close(DATEI); - + foreach (@Zeilen){ chomp($_); my @files = `find $_ -maxdepth 0 2>/dev/null`;