Crontab never executes in Windows Subsystem Linux

别等时光非礼了梦想. 提交于 2021-01-21 10:08:53

问题


I set up some cronjobs a while back using crontab -e. My crontab includes the following line:

* * * * * /usr/bin/touch /home/blah/MADEBYCRON

It's been weeks since I did this. I have never seen /home/blah/MADEBYCRON. I set permissions on my home directory so it should be able to create files in this directory, so why does this file never exist?

/var/log/syslog does not exist.


回答1:


Ensure that the cron service is running. I use WSL with cron every day for my local backups using rsync so this should work.

Use which cron to check its installed, mine says /usr/sbin/cron.

Use crontab -l to list your configured jobs.

Use ps aux | grep cron to look see if cron is running, you should see /usr/sbin/cron if it is.

Use service cron status to check if the service is started.

Use sudo service cron start to start the cron service if it is not running.



来源:https://stackoverflow.com/questions/60256901/crontab-never-executes-in-windows-subsystem-linux

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!