I will preface this by saying I am very new to command line programming with Debian Ubuntu…
I have been trying to set up a crontab list on a Debian Ubuntu server but have not been able to get it to work. Here is a sample:
MAILTO=myemail@gmail.com
* * * * * wall test
* * * * * /usr/bin/python2.6 /home/user/test.py > /home/user/clean_tmp_dir.log
The above shows up when I type “crontab -l” but no resulting output appears in the console. The “test.py” is supposed to generate a csv file but none is being created.
I am not receiving any output/error emails. I tried to find a log, but “var/log/cron” does not exist, nor does “etc/syslog.conf”…I tried to edit “etc/rsyslog.conf”, but got “E212: Can’t open file for writing”…I am logged in, however. Do I need some sort of special administrative privileges? Do I need to specify user or “root” or something?
Does anyone know what I’m doing wrong, how I can create/view a log, or how I can perform any other straightforward tests? Thanks!
Ok, let’s start over again.
Create a file, say
cron.txt, with exactly the following contents (1 line):(Do not create CRON_IS_RUNNING manually.) Run
which should quietly produce no output, then
which should print
Wait a minute or so, perhaps 2 minutes, then
which should print something like
If this all works, it will confirm that you can run cron jobs.
If that’s successful, the problem may be with your
test.pycommand. Does it work when you run it from the command line? If it works from the command line but not fromcron,test.pymight have some dependency on environment variables (cron jobs run with fewer environment variables set than interactive commands typically do).