Skip to content
Advertisement

Python cron job file access

I have a tiny Python script that needs to read/write to a file. It works when I run it from the command line (since I am root, it will) , but when the cron job runs it cannot access the file.

The file is in the same folder as the script and is (should) be created from the script.

I’m not sure if this is really a programming question…

Advertisement

Answer

Please use absolute path in your script when using crontab to run it

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement