Add usage and verbose output option for what the cron file is getting accomplished.

This commit is contained in:
2025-06-16 14:01:25 -06:00
parent 0e761c5112
commit a3ce3a7ee1

View File

@ -19,15 +19,39 @@ if (( $RUNNING > 0 )); then
exit $RUNNING
fi
verbose=""
case "$1" in
"-h")
cat <<- EOF
Script to help with scheduling Nextcloud's cron requirements.
Usage: $PROG [-h|-v]
-h) Display the usage and help text.
-v) Pass a verbose request to cron.php.
EOF
exit 0
;;
"-v")
verbose="-v"
;;
*)
echo "ERROR: Unknown parameter '$1', exiting."
$DIR/$PROG -h
;;
esac
# 2023-08-25 From crontab.
source $DIR/.env
if [[ -f $DIR/.env ]]; then
source $DIR/.env
else
PHP_MEMORY_LIMIT=256M
fi
sh -c "
docker exec nc-app \
sudo -u www-data \
php \
-d apc.enable_cli=1 \
-d memory_limit=$PHP_MEMORY_LIMIT \
-f cron.php \
-f cron.php $verbose \
"
# 2023-08-25 From fixes.sh, keep ownership correct and apps up to date.