diff --git a/duplicity-backup.conf.example b/duplicity-backup.conf.example index cd74d80..ccb407e 100644 --- a/duplicity-backup.conf.example +++ b/duplicity-backup.conf.example @@ -208,6 +208,9 @@ INCLIST=( "/home/foobar_user_name/Documents/" ) # "/**Icon?" \ # "/**.AppleDouble" \ # ) +# +# If you don't want to exclude anything, use EXCLIST=() +# # Simpler example with one location. Adapt it to your needs. EXCLIST=( "/home/foobar_user_name/Documents/foobar-to-exclude" ) diff --git a/duplicity-backup.sh b/duplicity-backup.sh index 0dba351..a6eaaec 100755 --- a/duplicity-backup.sh +++ b/duplicity-backup.sh @@ -563,7 +563,7 @@ include_exclude() OLDIFS=$IFS IFS=$(echo -en "\t\n") - # Exlcude device files? + # Exclude device files? if [ ! -z "${EXDEVICEFILES}" ] && [ "${EXDEVICEFILES}" -ne 0 ]; then TMP=" --exclude-device-files" EXCLUDE=${EXCLUDE}${TMP} @@ -571,14 +571,18 @@ include_exclude() for include in "${INCLIST[@]}" do - TMP=" --include='$include'" - INCLUDE=${INCLUDE}${TMP} + if [[ -n "$include" ]]; then + TMP=" --include='$include'" + INCLUDE=${INCLUDE}${TMP} + fi done for exclude in "${EXCLIST[@]}" do - TMP=" --exclude '$exclude'" - EXCLUDE=${EXCLUDE}${TMP} + if [[ -n "$exclude" ]]; then + TMP=" --exclude '$exclude'" + EXCLUDE=${EXCLUDE}${TMP} + fi done # Include/Exclude globbing filelist