Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cron standard #736

Merged
merged 5 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

38 changes: 0 additions & 38 deletions root/etc/s6-overlay/s6-rc.d/init-mod-universal-cron-setup/run

This file was deleted.

This file was deleted.

This file was deleted.

30 changes: 30 additions & 0 deletions root/etc/s6-overlay/s6-rc.d/init-mod-universal-crontab-config/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash

for cron_user in abc root; do
# make folders
mkdir -p \
/config/crontabs

# 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
crontab -l -u "${cron_user}" >"/config/crontabs/${cron_user}"
fi

if [[ -f "/defaults/crontabs/${cron_user}" ]]; then
# if crontabs still do not exist in config (were not copied from system)
# copy crontab from image defaults (using -n, do not overwrite an existing file)
cp -n "/defaults/crontabs/${cron_user}" /config/crontabs/
fi

# if crontabs still do not exist in config (were not copied from system)
# copy crontab from mod defaults (using -n, do not overwrite an existing file)
cp -n "/defaults/crontabs-mod/${cron_user}" /config/crontabs/
fi

# set permissions and import user crontabs
lsiown "${cron_user}":"${cron_user}" "/config/crontabs/${cron_user}"
crontab -u "${cron_user}" "/config/crontabs/${cron_user}"
done
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/init-mod-universal-crontab-config/run
10 changes: 0 additions & 10 deletions root/etc/s6-overlay/s6-rc.d/svc-mod-universal-cron/run

This file was deleted.

1 change: 0 additions & 1 deletion root/etc/s6-overlay/s6-rc.d/svc-mod-universal-cron/type

This file was deleted.

Empty file.
Empty file.