Skip to content

Commit

Permalink
Merge pull request #201 from linuxserver/3.18-cron-redirect-stderr
Browse files Browse the repository at this point in the history
Redirect stderr from cron
  • Loading branch information
nemchik authored Nov 2, 2023
2 parents cf5896c + 8b9dbd0 commit 89ebe1c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion root/etc/s6-overlay/s6-rc.d/init-crontab-config/run
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ for cron_user in abc root; do
# if crontabs do not exist in config
if [[ ! -f "/config/crontabs/${cron_user}" ]]; then
# copy crontab from system
if crontab -l -u "${cron_user}" >/dev/null; then
if crontab -l -u "${cron_user}" >/dev/null 2>&1; then
crontab -l -u "${cron_user}" >"/config/crontabs/${cron_user}"
fi

Expand Down
4 changes: 2 additions & 2 deletions root/etc/s6-overlay/s6-rc.d/svc-cron/run
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash

if builtin command -v crontab >/dev/null && [[ -n "$(crontab -l -u abc)" || -n "$(crontab -l -u root)" ]]; then
if builtin command -v busybox >/dev/null && [[ $(busybox) =~ [[:space:]](crond)([,]|$) ]]; then
if builtin command -v crontab >/dev/null 2>&1 && [[ -n "$(crontab -l -u abc)" || -n "$(crontab -l -u root)" ]]; then
if builtin command -v busybox >/dev/null 2>&1 && [[ $(busybox) =~ [[:space:]](crond)([,]|$) ]]; then
exec busybox crond -f -S -l 5
elif [[ -f /usr/bin/apt ]] && [[ -f /usr/sbin/cron ]]; then
exec /usr/sbin/cron -f -L 5
Expand Down

0 comments on commit 89ebe1c

Please sign in to comment.