From fb7f62defeb150448c495f1c3731f44d05e208fe Mon Sep 17 00:00:00 2001 From: Ryan Ahearn Date: Sat, 28 Dec 2024 22:41:19 -0500 Subject: [PATCH] Use crontab utility to install new crontabs --- 10/entrypoint.sh | 2 +- 11/entrypoint.sh | 2 +- 12/entrypoint.sh | 2 +- 13/entrypoint.sh | 2 +- 14/entrypoint.sh | 2 +- 15/entrypoint.sh | 2 +- 16/entrypoint.sh | 2 +- Makefile | 2 +- template/entrypoint.sh | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/10/entrypoint.sh b/10/entrypoint.sh index 119e8b5..78d2a8c 100755 --- a/10/entrypoint.sh +++ b/10/entrypoint.sh @@ -7,6 +7,6 @@ if [[ $@ == *crond* ]] && [ -z "$CRON_SCHEDULE" ]; then fi # Write cron schedule -echo "$CRON_SCHEDULE python3 -u /backup/backup.py > /dev/stdout" > /var/spool/cron/crontabs/root +echo "$CRON_SCHEDULE python3 -u /backup/backup.py > /dev/stdout" | crontab - exec "$@" diff --git a/11/entrypoint.sh b/11/entrypoint.sh index 119e8b5..78d2a8c 100755 --- a/11/entrypoint.sh +++ b/11/entrypoint.sh @@ -7,6 +7,6 @@ if [[ $@ == *crond* ]] && [ -z "$CRON_SCHEDULE" ]; then fi # Write cron schedule -echo "$CRON_SCHEDULE python3 -u /backup/backup.py > /dev/stdout" > /var/spool/cron/crontabs/root +echo "$CRON_SCHEDULE python3 -u /backup/backup.py > /dev/stdout" | crontab - exec "$@" diff --git a/12/entrypoint.sh b/12/entrypoint.sh index 119e8b5..78d2a8c 100755 --- a/12/entrypoint.sh +++ b/12/entrypoint.sh @@ -7,6 +7,6 @@ if [[ $@ == *crond* ]] && [ -z "$CRON_SCHEDULE" ]; then fi # Write cron schedule -echo "$CRON_SCHEDULE python3 -u /backup/backup.py > /dev/stdout" > /var/spool/cron/crontabs/root +echo "$CRON_SCHEDULE python3 -u /backup/backup.py > /dev/stdout" | crontab - exec "$@" diff --git a/13/entrypoint.sh b/13/entrypoint.sh index 119e8b5..78d2a8c 100755 --- a/13/entrypoint.sh +++ b/13/entrypoint.sh @@ -7,6 +7,6 @@ if [[ $@ == *crond* ]] && [ -z "$CRON_SCHEDULE" ]; then fi # Write cron schedule -echo "$CRON_SCHEDULE python3 -u /backup/backup.py > /dev/stdout" > /var/spool/cron/crontabs/root +echo "$CRON_SCHEDULE python3 -u /backup/backup.py > /dev/stdout" | crontab - exec "$@" diff --git a/14/entrypoint.sh b/14/entrypoint.sh index 119e8b5..78d2a8c 100755 --- a/14/entrypoint.sh +++ b/14/entrypoint.sh @@ -7,6 +7,6 @@ if [[ $@ == *crond* ]] && [ -z "$CRON_SCHEDULE" ]; then fi # Write cron schedule -echo "$CRON_SCHEDULE python3 -u /backup/backup.py > /dev/stdout" > /var/spool/cron/crontabs/root +echo "$CRON_SCHEDULE python3 -u /backup/backup.py > /dev/stdout" | crontab - exec "$@" diff --git a/15/entrypoint.sh b/15/entrypoint.sh index 119e8b5..78d2a8c 100755 --- a/15/entrypoint.sh +++ b/15/entrypoint.sh @@ -7,6 +7,6 @@ if [[ $@ == *crond* ]] && [ -z "$CRON_SCHEDULE" ]; then fi # Write cron schedule -echo "$CRON_SCHEDULE python3 -u /backup/backup.py > /dev/stdout" > /var/spool/cron/crontabs/root +echo "$CRON_SCHEDULE python3 -u /backup/backup.py > /dev/stdout" | crontab - exec "$@" diff --git a/16/entrypoint.sh b/16/entrypoint.sh index 119e8b5..78d2a8c 100755 --- a/16/entrypoint.sh +++ b/16/entrypoint.sh @@ -7,6 +7,6 @@ if [[ $@ == *crond* ]] && [ -z "$CRON_SCHEDULE" ]; then fi # Write cron schedule -echo "$CRON_SCHEDULE python3 -u /backup/backup.py > /dev/stdout" > /var/spool/cron/crontabs/root +echo "$CRON_SCHEDULE python3 -u /backup/backup.py > /dev/stdout" | crontab - exec "$@" diff --git a/Makefile b/Makefile index c3bebf3..aee3226 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,2 @@ update: - python update.py + python3 update.py diff --git a/template/entrypoint.sh b/template/entrypoint.sh index 119e8b5..78d2a8c 100755 --- a/template/entrypoint.sh +++ b/template/entrypoint.sh @@ -7,6 +7,6 @@ if [[ $@ == *crond* ]] && [ -z "$CRON_SCHEDULE" ]; then fi # Write cron schedule -echo "$CRON_SCHEDULE python3 -u /backup/backup.py > /dev/stdout" > /var/spool/cron/crontabs/root +echo "$CRON_SCHEDULE python3 -u /backup/backup.py > /dev/stdout" | crontab - exec "$@"