###########################
# test crond
# https://www.linuxfixes.com/2022/01/solved-docker-cron-scheduled-job-not.html
# https://www.onitroad.com/jc/linux/how-to-install-and-configure-log-roate-in-alpine-linux.html
# https://weinan.io/2019/04/06/cron.html
# https://unix.stackexchange.com/questions/375577/why-is-crond-failing-to-run-a-non-root-crontab-on-alpine-linux
#
#############################
apk list -I | grep 'log'
mkdir /etc/periodic/1min
echo "*/1 * * * * run-parts /etc/periodic/1min" >> /etc/crontabs/root
tee /etc/periodic/1min/foo <<EOF
#!/bin/sh
echo "Hello, world"
date >> /tmp/foo_crond
EOF
crond -f -l 8
# Your can run in out side to start cornd
docker exec -d share_nginx crond -f -l 8
沒有留言:
張貼留言