From a3ce3a7ee166ef22b183eb98055e3f7b97ba003d Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 16 Jun 2025 14:01:25 -0600 Subject: [PATCH] Add usage and verbose output option for what the cron file is getting accomplished. --- Config/Nextcloud/cron.sh | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/Config/Nextcloud/cron.sh b/Config/Nextcloud/cron.sh index a9963ac..8672ca0 100755 --- a/Config/Nextcloud/cron.sh +++ b/Config/Nextcloud/cron.sh @@ -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.