From: Hugo Villeneuve Date: Sat, 9 Feb 2013 16:21:28 +0000 (-0500) Subject: Réglé problèmes avec script de backup (.gvfs permission errors) X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=0fe40c084b253c4bfe613e28a121c05925efb92f;p=hvlinux.git Réglé problèmes avec script de backup (.gvfs permission errors) --- 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}