30 3 * * 0 root test -e /run/systemd/system || @pkglibdir@/e2scrub_all_cron
-10 3 * * * root test -e /run/systemd/system || @root_sbindir@/e2scrub_all -A -r
+10 3 * * * root test -e /run/systemd/system || @root_sbindir@/e2scrub_all -C -A -r
fi
scrub_all=0
+run_from_cron=0
snap_size_mb=256
reap=0
conffile="@root_sysconfdir@/e2scrub.conf"
"n") DBG="echo Would execute: " ;;
"r") scrub_args="${scrub_args} -r"; reap=1;;
"A") scrub_all=1;;
+ "C") run_from_cron=1;;
"V") print_version; exitcode 0;;
*) print_help; exitcode 2;;
esac
# when e2scrub_all is run out of cron or a systemd timer.
if ! type lsblk >& /dev/null ; then
+ if [ "${run_from_cron}" -eq 1 ] ; then
+ exitcode 0
+ fi
echo "e2scrub_all: can't find lsblk --- is util-linux installed?"
- exitcode 0
+ exitcode 1
fi
if ! type lvcreate >& /dev/null ; then
+ if [ "${run_from_cron}" -eq 1 ] ; then
+ exitcode 0
+ fi
echo "e2scrub_all: can't find lvcreate --- is lvm2 installed?"
- exitcode 0
+ exitcode 1
fi
# Find scrub targets, make sure we only do this once.
[Service]
Type=oneshot
Environment=SERVICE_MODE=1
-ExecStart=@root_sbindir@/e2scrub_all
+ExecStart=@root_sbindir@/e2scrub_all -C
SyslogIdentifier=e2scrub_all