Hi,
I want to run a python code at boot, but it is not working. I have created a file cron_test in /etc/cron.d/
Code:
# /etc/cron.d/cron_test
# tests how to run a python script at startup
@reboot touch /home/mick/ct.log
@reboot ./home/mick/cron_test.sh
cron_test_sh is
Code:
cd /home/mick
touch ct_sh.log
./cron_test.py
and cron_test.py is
Code:
#!/usr/bin/python
strt_log_file = open('/home/mick/test.log', 'a')
pr_str = "\n\n\t\t#########################################\n"
pr_str = pr_str + "\t\t### Test of cron jobs. ###\n"
pr_str = pr_str + "\t\t#########################################\n"
pr_str = pr_str + "\n\nEnd of cron test file ..."
strt_log_file.write(pr_str)
if I run cron_test.sh in a terminal is works fine, but when I reboot it does nothing, even the touch in cron_test within cron.d does not happen.
What have I missed?
I am running Ubuntu Karmic (9.10)
Thanks
Mick