- 140
- 1
I'm writing a simple script that writes to a csv file. When ran from console it works fine. When ran with cron, it doesn't write. No errors in the log. All files and folders are 777. The cron is active and running. What am I missing?
The discussion centers on troubleshooting a Python script that writes to a CSV file when executed via cron. The user discovered that the script failed to run due to a relative file path issue, which is a common pitfall with cron jobs. Recommendations included using the logger command to confirm script execution and ensuring absolute paths are used for file operations. The conversation also highlighted the importance of understanding cron's security settings and the need for proper logging to diagnose issues effectively.
PREREQUISITESPython developers, system administrators, and anyone managing cron jobs or working with CSV file operations in Linux environments will benefit from this discussion.
$ dmesg
$ cat /var/log/syslog
#!/bin/bash
logger "Running simple script that writes to csv file"
Agreed, I'm just a few months in and I love it. It's so clean. Looking at nested indents can take getting used to. There are also so many libraries, great community.Jameson said:Seems like a good place to ask this, how many of you use Python at work or for personal projects? 3 years ago I had never once touched it now it’s my go to language. Still not my best but the dominance it has in data science plus the huge variety of tasks it can do are very appealing.