I have a Python script that runs from the command line beautifully, but when I try and run it from CRON does strange things.
The script generates, then runs an apk script file.
The apk script file is saved in
/usr/src/scripts/plots/core_temp_data/weeklyplots when run via the command line; but it is saved in
/home/pi when run from CRON.
I've also tried writing the CRON errors to a logfile, but that is placed in the
/home/pi directory too!
The script is working, but saving the resultant files in the wrong place, so how do I specify the correct path?
I've tried searching for how to specify the path, but got myself horribly confused.
The part of the script that generates the apk script is
fout = open("live_gnu_command.gpl", "w")
following D_byes help this worked:
fout = open("/usr/src/scripts/plots/core_temp_data/weeklyplotslive_gnu_command.gpl", "w")