From: Cameron Nemo Date: Sat, 24 Nov 2018 03:28:06 +0000 (-0800) Subject: sv: only invoke run-parts if the directory exists X-Git-Tag: v0.4~2 X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=c95b0c00842219d98d43a5f859ecbb995e4d438e;hp=-c;p=user%2Fhenk%2Fcode%2Fsnooze.git sv: only invoke run-parts if the directory exists Closes: #7 [via git-merge-pr] --- c95b0c00842219d98d43a5f859ecbb995e4d438e diff --git a/sv/snooze-daily/run b/sv/snooze-daily/run index 45b4d07..ee629a7 100755 --- a/sv/snooze-daily/run +++ b/sv/snooze-daily/run @@ -1,4 +1,4 @@ #!/bin/sh mkdir -p /var/cache/snooze exec snooze -s 1d -t /var/cache/snooze/daily -- sh -c \ - "run-parts --lsbsysinit /etc/cron.daily; : > /var/cache/snooze/daily" + "test -d /etc/cron.daily && run-parts --lsbsysinit /etc/cron.daily; : > /var/cache/snooze/daily" diff --git a/sv/snooze-hourly/run b/sv/snooze-hourly/run index d9a3f0b..053392e 100755 --- a/sv/snooze-hourly/run +++ b/sv/snooze-hourly/run @@ -1,4 +1,4 @@ #!/bin/sh mkdir -p /var/cache/snooze exec snooze -H \* -s 1h -t /var/cache/snooze/hourly -- sh -c \ - "run-parts --lsbsysinit /etc/cron.hourly; : > /var/cache/snooze/hourly" + "test -d /etc/cron.hourly && run-parts --lsbsysinit /etc/cron.hourly; : > /var/cache/snooze/hourly" diff --git a/sv/snooze-monthly/run b/sv/snooze-monthly/run index f506a79..b83c500 100755 --- a/sv/snooze-monthly/run +++ b/sv/snooze-monthly/run @@ -1,4 +1,4 @@ #!/bin/sh mkdir -p /var/cache/snooze exec snooze -d 1 -s 28d -t /var/cache/snooze/monthly -- sh -c \ - "run-parts --lsbsysinit /etc/cron.monthly; : > /var/cache/snooze/monthly" + "test -d /etc/cron.monthly && run-parts --lsbsysinit /etc/cron.monthly; : > /var/cache/snooze/monthly" diff --git a/sv/snooze-weekly/run b/sv/snooze-weekly/run index a3228c7..0a6b849 100755 --- a/sv/snooze-weekly/run +++ b/sv/snooze-weekly/run @@ -1,4 +1,4 @@ #!/bin/sh mkdir -p /var/cache/snooze exec snooze -w 0 -s 7d -t /var/cache/snooze/weekly -- sh -c \ - "run-parts --lsbsysinit /etc/cron.weekly; : > /var/cache/snooze/weekly" + "test -d /etc/cron.weekly && run-parts --lsbsysinit /etc/cron.weekly; : > /var/cache/snooze/weekly"