From 0fe40c084b253c4bfe613e28a121c05925efb92f Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Sat, 9 Feb 2013 11:21:28 -0500 Subject: [PATCH] =?utf8?q?R=C3=A9gl=C3=A9=20probl=C3=A8mes=20avec=20script?= =?utf8?q?=20de=20backup=20(.gvfs=20permission=20errors)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- stage2/hv-utilities/hv-backup | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/stage2/hv-utilities/hv-backup b/stage2/hv-utilities/hv-backup index 94ad6d8..81e2c96 100755 --- a/stage2/hv-utilities/hv-backup +++ b/stage2/hv-utilities/hv-backup @@ -19,7 +19,7 @@ source /etc/backup.conf ARCHIVE_LABEL="backup-data-amd64-`date '+%Y-%m-%d'`" # Exclude files list -EXC_LIST="/tmp/exclude-sockets" +EXC_LIST="/tmp/hv-backup-exclude-list" print_usage() { @@ -59,15 +59,32 @@ ARCHIVE_NAME=${BKP_DEST_DIR}/${ARCHIVE_LABEL}.tar.bz2 echo "ARCHIVE_LABEL=$ARCHIVE_LABEL" -# Finding sockets -find ${DIRECTORIES} -type s > ${EXC_LIST} || exit 1 +cat > ${EXC_LIST} << "EOF" +/media/* +/proc/* +/dev/* +/sys/* +/tmp/* +*.sock +*.lock +*/.gvfs* +EOF + +# Finding sockets, and listing them in the exclude file. +# Errors and warnings must be discarded because of .gvfs directory for example. +# Even when using -prune option, find exits with a non-zero status when resding +# .gvfs +find ${BKP_FILES_LIST} -type s >> ${EXC_LIST} 2> /dev/null # Archiving tar jcf ${ARCHIVE_NAME} ${BKP_FILES_LIST} \ - --ignore-failed-read \ --label="${ARCHIVE_LABEL}" \ - --exclude="*.sock" --exclude="*.lock" --exclude-from=${EXC_LIST} \ - --absolute-names --totals + --ignore-failed-read \ + --exclude-backups \ + --exclude-caches \ + --exclude-from=${EXC_LIST} \ + --absolute-names \ + --totals rm ${EXC_LIST} -- 2.20.1