mirror of
https://github.com/skoelle/icloud-contacts-sync.git
synced 2026-09-17 15:30:24 +00:00
scheduler in python
This commit is contained in:
@@ -1,2 +0,0 @@
|
||||
*/15 * * * * /usr/local/bin/run-sync.sh >> /proc/1/fd/1 2>> /proc/1/fd/2
|
||||
0 7 * * * /usr/local/bin/run-mailer.sh >> /proc/1/fd/1 2>> /proc/1/fd/2
|
||||
+2
-13
@@ -7,18 +7,7 @@ if [ $# -gt 0 ]; then
|
||||
exec "$@"
|
||||
fi
|
||||
|
||||
MAIL_HOUR="${MAIL_SEND_HOUR:-7}"
|
||||
|
||||
echo "Starte icloud-contacts-sync Container"
|
||||
echo "Sync-Schedule: */15 * * * * (alle 15 Minuten, Delta-Sync)"
|
||||
echo "Mailer-Schedule: taeglich um ${MAIL_HOUR} Uhr (falls MAILER_ENABLED=true)"
|
||||
echo "Scheduler: Python-basiert (kein supercronic)"
|
||||
|
||||
# Crontab wird zur Laufzeit generiert, damit MAIL_SEND_HOUR konfigurierbar bleibt.
|
||||
cat > /etc/crontabs/app-crontab <<EOF
|
||||
*/15 * * * * /usr/local/bin/run-sync.sh >> /proc/1/fd/1 2>> /proc/1/fd/2
|
||||
0 ${MAIL_HOUR} * * * /usr/local/bin/run-mailer.sh >> /proc/1/fd/1 2>> /proc/1/fd/2
|
||||
EOF
|
||||
|
||||
/usr/local/bin/run-sync.sh || echo "Initialer Sync fehlgeschlagen, Cron laeuft trotzdem weiter"
|
||||
|
||||
exec supercronic -json /etc/crontabs/app-crontab
|
||||
exec python3 /app/scheduler.py
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
cd /app
|
||||
echo "$(date -Is) - Mailer-Lauf gestartet"
|
||||
python3 /app/mailer.py
|
||||
echo "$(date -Is) - Mailer-Lauf beendet"
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
cd /app
|
||||
echo "$(date -Is) - Sync-Lauf gestartet"
|
||||
python3 /app/sync.py
|
||||
echo "$(date -Is) - Sync-Lauf beendet"
|
||||
touch /tmp/last_sync_ok
|
||||
Reference in New Issue
Block a user