check dir before writing status file

This commit is contained in:
2022-11-24 22:14:03 +01:00
parent 4793a9c9e5
commit 762c7ef47a

View File

@@ -13,5 +13,5 @@ error=$?
if [ $error -eq 0 ] ; then
find $rdir -maxdepth 1 -type d -mtime +${rotate} -exec rm -fr {} \;
fi
echo $error > $status_file
test -d $(dirname $status_file) && echo $error > $status_file
exit $error