Merge pull request #146 from linuxserver/jammy-cron-redirect-stderr

Redirect stderr from cron
pull/150/head jammy-c3aef6a6-ls85
Eric Nemchik 2023-11-02 16:12:55 -05:00 zatwierdzone przez GitHub
commit fbbe06d560
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -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

Wyświetl plik

@ -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