A Raspberry Pi (raspian wheezy) has a cronjob, created as user pi with "sudo crontab -e" so it should has root grants.
ps aux | grep /home/.../myscript.py
...say it's owner is user "pi"!? (is this correct?)
The python script called from crontab is working fine if i call it from the terminal. It's reading data from UART (serial port), and save it into a mysql database. My python script got 'chmod 777' grants.
The crontab file:
@reboot sudo python /home/pi/pythonprogram/myscript.py & > /home/pi/pythonprogram/myscript.log
crontab log file:
Error mysql: 2002 Can't connect to local MYSQL server throught socket '/var/run/mysqld/mysqld.sock' (2)
May it be that my script is called first, before the server (mysql and apache) are running during the boot up process? Is there a way to prevent this?
What else could be the reason for those error?