Changed order of -s in the mail call for compatibility, from
[matthijs/upstream/backupninja.git] / src / backupninja.in
index 57936da1d4b2ce5a521dcbdae05c3ee7ed218aa7..fb6cc16e39eea4d4f917662bff30f5b63017c41f 100755 (executable)
@@ -476,7 +476,11 @@ errormsg=""
 if [ "$singlerun" ]; then
        files=$singlerun
 else
-       files=`find $configdirectory -mindepth 1 -maxdepth 1 -type f ! -name '.*.swp' | sort -n`
+       files=`find -L $configdirectory -mindepth 1 -maxdepth 1 -type f ! -name '.*.swp' | sort -n`
+
+       if [ -z "$files" ]; then
+               fatal "No backup actions configured in '$configdirectory', run ninjahelper!"
+       fi
 fi
 
 for file in $files; do
@@ -522,7 +526,7 @@ if [ $doit == 1 ]; then
                        echo ${messages[$i]}
                done
                echo -e "$errormsg"
-       } | mail $reportemail -s "backupninja: $hostname $subject"
+       } | mail -s "backupninja: $hostname $subject" $reportemail
 fi
 
 if [ $actions_run != 0 ]; then