diff options
author | Leandro Lucarella <luca@llucax.com> | 2020-06-13 18:16:56 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2020-06-13 18:22:44 +0300 |
commit | 337ffeb1c522f9fd2d4d5c1909436890db8c8505 (patch) | |
tree | 7908fece3333f913890d27462228f601848a1011 | |
parent | 4e7938650f55bdf8b656d647b5aeed6c0c04e9ee (diff) |
ncp-autoupdate: cronjob write to the log only (#1144)v1.26.2
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 <luca@llucax.com>
Signed-off-by: nachoparker <nacho@ownyourbits.com>
-rw-r--r-- | bin/ncp/UPDATES/nc-autoupdate-ncp.sh | 3 | ||||
-rw-r--r-- | changelog.md | 6 | ||||
-rw-r--r-- | 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 <<EOF #!/bin/bash source /usr/local/etc/library.sh +# Forward all output to the ncp log +exec > /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 |