Commit dc7add76 authored by Matthew Smith's avatar Matthew Smith
Browse files

Quick and simple 'ls' check on include directories, abort backup if none of...

Quick and simple 'ls' check on include directories, abort backup if none of them contain any files or directories cause that can screw up increments.
parent f25b0d22
......@@ -394,13 +394,21 @@ for i in $exclude; do
str="${i// /\\\ }"
execstr="${execstr}--exclude '$str' "
done
# includes
# Assume all includes are empty
areincludesempty=true
for i in $include; do
[ "$i" != "/" ] || fatal "Sorry, you cannot use 'include = /'"
# Escape spaces (backslashes should not have been in first place...)
str="${i// /\\\ }"
# Set not empty if any have files or directories
ls "${str}/*" > 2&>1 /dev/null ; [ $? -eq 0 ] || areincludesempty=false
execstr="${execstr}--include '$str' "
done
# Don't backup a source that includes no files or folders
[ $areincludesempty = true ] && fatal "Source includes contain no files or folders, aborting backup"
IFS=$old_ifs
# vsinclude
if [ $usevserver = yes ]; then
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment