From 337ffeb1c522f9fd2d4d5c1909436890db8c8505 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Sat, 13 Jun 2020 17:16:56 +0200 Subject: ncp-autoupdate: cronjob write to the log only (#1144) Cronjobs should not have any output, unless the cronjob fails, otherwise an e-mail notification is sent with the output. This cronjob in particular is also reporting results via Nextcloud notification, so having an e-mail with logs saying the same as the notification is not particularly useful. Instead we just redirect all output to the /var/log/ncp.log so the user can debug in case of problems and doesn't receive spurious e-mails when all works fine. Signed-off-by: Leandro Lucarella Signed-off-by: nachoparker --- bin/ncp/UPDATES/nc-autoupdate-ncp.sh | 3 +++ changelog.md | 6 ++++-- etc/library.sh | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/bin/ncp/UPDATES/nc-autoupdate-ncp.sh b/bin/ncp/UPDATES/nc-autoupdate-ncp.sh index 6aa00f68..69d3e331 100644 --- a/bin/ncp/UPDATES/nc-autoupdate-ncp.sh +++ b/bin/ncp/UPDATES/nc-autoupdate-ncp.sh @@ -20,6 +20,9 @@ configure() cat > /etc/cron.daily/ncp-autoupdate < /var/log/ncp.log 2>&1 +echo "\$(date) - Running \$0..." if /usr/local/bin/ncp-test-updates; then /usr/local/bin/ncp-update || exit 1 notify_admin "NextCloudPi" "NextCloudPi was updated to \$(cat /usr/local/etc/ncp-version)" diff --git a/changelog.md b/changelog.md index f95b24d8..23c26b63 100644 --- a/changelog.md +++ b/changelog.md @@ -1,7 +1,9 @@ -[v1.26.1](https://github.com/nextcloud/nextcloudpi/commit/8e36668) (2020-06-13) ncp-web: fix port checking +[v1.26.2](https://github.com/nextcloud/nextcloudpi/commit/d1a46c6) (2020-06-13) ncp-autoupdate: cronjob write to the log only (#1144) -[v1.26.0](https://github.com/nextcloud/nextcloudpi/commit/aedd8f0) (2020-06-11) upgrade to NC18.0.5 +[v1.26.1](https://github.com/nextcloud/nextcloudpi/commit/4e79386) (2020-06-13) ncp-web: fix port checking + +[v1.26.0 ](https://github.com/nextcloud/nextcloudpi/commit/aedd8f0) (2020-06-11) upgrade to NC18.0.5 [v1.25.0 ](https://github.com/nextcloud/nextcloudpi/commit/ed3619f) (2020-04-24) upgrade to NC18.0.4 diff --git a/etc/library.sh b/etc/library.sh index 5b6c7589..04e19392 100644 --- a/etc/library.sh +++ b/etc/library.sh @@ -127,7 +127,7 @@ function run_app_unsafe() chown root:www-data $log echo "Running $ncp_app" - echo "[ $ncp_app ]" >> $log + echo "[ $ncp_app ] ($(date))" >> $log # read script unset configure -- cgit v1.2.3