Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Crontab never executes in Windows Subsystem Linux

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.

like image 693
guninvalid Avatar asked Feb 17 '20 06:02

guninvalid


1 Answers

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.

like image 164
Damo Avatar answered Nov 10 '22 10:11

Damo