1
0
Fork 0
immich-folder-album-creator/docker/setup_cron.sh
Salvoxia 6e03f209ef Docker
Reset crontab file before adding the cron expression to prevent multiplying the same entry on every container restart
Fixes #1
2024-02-26 21:59:17 +01:00

11 lines
327 B
Bash

#!/usr/bin/env sh
if [ ! -z "$CRON_EXPRESSION" ]; then
CRONTAB="$CRON_EXPRESSION /script/immich_auto_album.sh > /proc/1/fd/1 2>/proc/1/fd/2"
# Reset crontab
crontab -r
(crontab -l 2>/dev/null; echo "$CRONTAB") | crontab -
# Make environment variables accessible to cron
printenv > /etc/environment
fi