В WSL Ubuntu 16.04 запустил nano /etc/cron.d/cronjobs и там я написал * * * * * touch /var/www/html/myFile (это единственные данные в этом файле ). Я сохранил файл, подождал минуту, но файл не был создан в /var/www/html/.
Я удостоверился, что служба cron работает (service cron start), получила «ОК» и подождала еще минуту.
Тем не менее, touch не действует --- файл по имени myFile не создан в /var/www/html.
Что я пропустил? [ ! d9]
В отличие от пользовательских crontabs, задания в /etc/cron.d (например, в файле crontab всей системы /etc/crontab) требуется дополнительное поле для указания пользователя, например
* * * * * root touch /var/www/html/myFile
From man 8 cron:
Additionally, in Debian, cron reads the files in the /etc/cron.d direc‐
tory. cron treats the files in /etc/cron.d as in the same way as the
/etc/crontab file (they follow the special format of that file, i.e.
they include the user field).
В отличие от пользовательских crontabs, задания в /etc/cron.d (например, в файле crontab всей системы /etc/crontab) требуется дополнительное поле для указания пользователя, например
* * * * * root touch /var/www/html/myFile
From man 8 cron:
Additionally, in Debian, cron reads the files in the /etc/cron.d direc‐
tory. cron treats the files in /etc/cron.d as in the same way as the
/etc/crontab file (they follow the special format of that file, i.e.
they include the user field).
В отличие от пользовательских crontabs, задания в /etc/cron.d (например, в файле crontab всей системы /etc/crontab) требуется дополнительное поле для указания пользователя, например
* * * * * root touch /var/www/html/myFile
From man 8 cron:
Additionally, in Debian, cron reads the files in the /etc/cron.d direc‐
tory. cron treats the files in /etc/cron.d as in the same way as the
/etc/crontab file (they follow the special format of that file, i.e.
they include the user field).