Skip to content

Commit

Permalink
fix: cron control issues
Browse files Browse the repository at this point in the history
  • Loading branch information
DDSRem committed Feb 20, 2024
1 parent da59953 commit f794dac
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
20 changes: 13 additions & 7 deletions cron/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
```shell
docker run -d \
docker run -itd \
--name=xiaoya-cron \
-e TZ=Asia/Shanghai \
-e EMBY= \
-e RESILIO= \
-e CRON= \
-v "${RESILIO_DIR}:/config" \
-v "${MEDIA_DIR}:/media" \
-v "${XIAOYA_DIR}:/etc/xiaoya" \
-e EMBY=xiaoya-emby \
-e RESILIO=xiaoya-resilio \
-e CRON="30 05 */3 * *" \
-e HOST_MEDIA_DIR=/ssd/data/docker/xiaoya/media \
-e HOST_RESILIO_DIR=/ssd/data/docker/xiaoya/resilio \
-e HOST_CONFIG_DIR=/ssd/data/docker/xiaoya/xiaoya \
-v "/ssd/data/docker/xiaoya/resilio:/ssd/data/docker/xiaoya/resilio" \
-v "/ssd/data/docker/xiaoya/media:/ssd/data/docker/xiaoya/media" \
-v "/ssd/data/docker/xiaoya/xiaoya:/ssd/data/docker/xiaoya/xiaoya" \
-v /tmp:/tmp \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
--net=host \
--restart=always \
ddsderek/xiaoya-cron:latest
```
4 changes: 2 additions & 2 deletions cron/rootfs/etc/s6-overlay/s6-rc.d/init-config/run
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ cd /app || exit

crontab -r

CRON_COMMAND="bash -c \"\$(curl http://docker.xiaoya.pro/sync_emby_config.sh)\" -s /media /etc/xiaoya ${EMBY} ${RESILIO}"
CRON_COMMAND="bash -c \"\$(curl http://docker.xiaoya.pro/sync_emby_config.sh)\" -s ${HOST_MEDIA_DIR} ${HOST_CONFIG_DIR} ${EMBY} ${RESILIO}"

echo -e "${CRON} ${CRON_COMMAND} >> /config/cron.log 2>&1" > /app/cronjob.list
echo -e "${CRON} ${CRON_COMMAND} >> ${HOST_RESILIO_DIR}/cron.log 2>&1" > /app/cronjob.list
echo -e "${CRON_COMMAND}" > /app/command.sh

INFO "$(cat /app/cronjob.list)"
Expand Down

0 comments on commit f794dac

Please sign in to comment.