How to configure cron using yocto?


Sourabh Hegde
 

Hello All,

I am trying to include the cron to my yocto (release Morty) image. In the image recipe I have added IMAGE_INSTALL_append = " cronie". This created the crontab and cron.d directory in /etc/. Also other directories like /etc/cron.daily/, /etc/cron.hourly/, are created. But when I flash the image to the board and try to add the cron job using "crontab -e" I get below error:

/var/spool/cron: No such file or directory
/var/spool/cron: mkdir: No such file or directory

Also when I try to start crond daemon with "/etc/init.d/crond start" I get below error

Starting crond: /var/spool/cron: No such file or directory
/var/spool/cron: mkdir: No such file or directory
FAIL

There is no systemd available. 
I noticed that these directories doesn't exist. The filesystem is read-only.
Is there anything I am missing in the image during build? How can I add cron jobs using "crontab -e" in this case? My cron jobs should run every 20mins.

P.S: Please let me know if you need any further info