/* この記事は、ライフ 人間と科学シリーズ(Plume)の閉鎖処理の一環として、投稿した情報の整理を行うために書かれた。 */
busybox crondでは、root所有ではないcronfileを黙ってスキップしてしまうらしい: dockerでBusyBox crondが動かない – numa blog
通常のcrondならエラーが出るっぽい: /etc/cron.dへ置くファイルにはownerとpermissionに制約があるっぽい - モヒカンメモ
$ echo '0 0 * * * root true' > root
$ docker run --rm -v $(pwd)/root:/etc/crontabs/root --init alpine timeout 3 \
sh -c 'mount | grep /etc/crontabs/root; \
ls -l /etc/crontabs/root; \
cat /etc/crontabs/root; crond -f -d 0'
/dev/sdc on /etc/crontabs/root type ext4 (rw,relatime,discard,errors=remount-ro,data=ordered)
-rw-r--r-- 1 1000 1000 20 Sep 27 17:42 /etc/crontabs/root
0 0 * * * root true
crond: crond (busybox 1.32.1) started, log level 0
$ echo '0 0 * * * root true' > root
$ sudo chown root:root root
$ ls -l root
-rw-r--r-- 1 root root 20 Sep 28 02:42 root
$ docker run --rm -v $(pwd)/root:/etc/crontabs/root --init alpine timeout 3 \
sh -c 'mount | grep /etc/crontabs/root; \
ls -l /etc/crontabs/root; \
cat /etc/crontabs/root; crond -f -d 0'
/dev/sdc on /etc/crontabs/root type ext4 (rw,relatime,discard,errors=remount-ro,data=ordered)
-rw-r--r-- 1 root root 20 Sep 27 17:42 /etc/crontabs/root
0 0 * * * root true
crond: crond (busybox 1.32.1) started, log level 0
crond: user:root entry:0 0 * * * root true
100000000000000000000000000000000000000000000000000000000000
100000000000000000000000
11111111111111111111111111111111
111111111111
1111111