Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a SAM9 based board running embedded linux using buildroot package.

I added the crond and crontab support to busybox from make menuconfig and built the rootfs and flashed it to my board.

The crond and crontab utilities were now present on the board.

I executed the following :

mkdir /var/spool/cron/
mkdir /var/spool/cron/crontabs/
crontab -e

Then added the following in the editor :

* * * * * "harsh" >> /root/harsh.txt

Then executed 'crond' and I was able to see it in the list of processes using 'ps' command.

Also the text line with 'harsh' was appeded to the file every minute.

But the problem is that when I reboot the board the 'cron' directory is deleted from /var/spool/ and the cron process also cannot be started as the cron configuration file itself resides in /var/spool/cron/

How to fix this ?

PS : I have also posted it on stackoverflow.com here -> http://stackoverflow.com/q/9392859/553094 but it seemed to me that serverfault.com is a more approriate place to ask this question

share|improve this question
add comment

1 Answer

You need to include the directories and crontab(s) in the boot image.

A flash OS unpacks the OS into RAM every time the system boots; there is no persistent filesystem for storage.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.