Run a script from a system cron file
A file in /etc/cron.d needs a user field after the five time fields, and on Debian a name with a dot is skipped. Both mistakes fail without any message.
A job dropped into /etc/cron.d never runs, and nothing in the output says why.
mkdir /tmp/cd
cat > /etc/cron.d/with-user <<'EOF'
* * * * * root date > /tmp/cd/with-user.txt
EOF
cat > /etc/cron.d/no-user <<'EOF'
* * * * * date > /tmp/cd/no-user.txt
EOF
cat > /etc/cron.d/dotted.conf <<'EOF'
* * * * * root date > /tmp/cd/dotted.txt
EOF
sleep 65
ls /tmp/cdwith-user.txtSystem crontabs differ from user crontabs by one extra field, the user to run as, after the five time fields. Without it the command is read as the user name and the line is wrong, so cron drops it. Debian's cron also reads only file names made of letters, digits, hyphens and _, as the cron manual describes, so a name ending in .conf is ignored. Only one of the three jobs ran.
Cron logs the rejection to syslog, which a container without a syslog daemon does not keep, so look in journalctl -u cron or /var/log/syslog on a real host. Files in /etc/cron.d must be owned by root and not writable by others. Other cron implementations may treat file names differently.