- 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 revolves around troubleshooting a Python script that writes to a CSV file when executed via cron. Participants explore potential issues related to script execution, file paths, and cron's behavior, while also sharing personal experiences with Python.
dmesg and cat /var/log/syslog to identify any errors, and suggests adding logging to the script to confirm it is running.Participants generally agree on the challenges of using cron and the importance of logging for troubleshooting. However, there is no consensus on the best practices for managing cron jobs or the relative merits of different programming languages.
Participants mention issues related to file paths and cron's execution environment, but do not resolve the broader implications of these challenges. The discussion includes personal anecdotes about programming experiences, which may not directly relate to the original troubleshooting issue.
Individuals interested in Python programming, troubleshooting cron jobs, or those exploring the use of Python in data science and database management may find this discussion relevant.
$ 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.