Skip to content

Commit

Permalink
standard cron
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Nemchik <[email protected]>
  • Loading branch information
nemchik committed Jul 30, 2023
1 parent 4fbe981 commit c73d76e
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 19 deletions.
2 changes: 2 additions & 0 deletions root/defaults/crontabs/abc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# min hour day month weekday command
0 3 * * * /app/blocklist-update.sh 2>&1
10 changes: 0 additions & 10 deletions root/etc/crontabs/root

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
mkdir -p \
/config/crontabs

## root
## abc
# if crontabs do not exist in config
if [[ ! -f /config/crontabs/root ]]; then
if [[ ! -f /config/crontabs/abc ]]; then
# copy crontab from system
if crontab -l -u root; then
crontab -l -u root >/config/crontabs/root
if crontab -l -u abc; then
crontab -l -u abc >/config/crontabs/abc
fi

# if crontabs still do not exist in config (were not copied from system)
# copy crontab from included defaults (using -n, do not overwrite an existing file)
cp -n /etc/crontabs/root /config/crontabs/
cp -n /defaults/crontabs/abc /config/crontabs/
fi
# set permissions and import user crontabs
lsiown root:root /config/crontabs/root
crontab -u root /config/crontabs/root
lsiown abc:abc /config/crontabs/abc
crontab -u abc /config/crontabs/abc
1 change: 1 addition & 0 deletions root/etc/s6-overlay/s6-rc.d/init-crontab-config/up
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/init-crontab-config/run
1 change: 0 additions & 1 deletion root/etc/s6-overlay/s6-rc.d/init-crontabs-config/up

This file was deleted.

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

exec /usr/sbin/crond -f -S -l 5
exec busybox crond -f -S -l 5

0 comments on commit c73d76e

Please sign in to comment.