python script execution through crontab
Question: what happens to my script in python that does not run through crontab every
minute. My script has execute permissions and then calls two other scripts in
python.

    
    
    This is the content of my crontab (#crontab -l):
    */1 * * * * /usr/bin/rsm/samplesMonitor.py
    

` Thank you guys.


Answer: Check `/var/log/syslog` for errors.

    
    
    DIAGNOSTICS
           cron requires that each entry in a crontab end in a 
           newline character. If the last entry in a crontab is 
           missing a newline (ie, terminated by  EOF),  cron  will 
           consider the crontab (at least partially) broken. A 
           warning will be written to syslog.
    

* * *

**Update:** According to your log message, the script is running but returning
an error code. Cron will email you the output, if you have a mail agent
installed.

Try either:

  1. install a mail agent, such as: `apt-get install exim4`
  2. change your cron line to log to file, like so:
    
        * * * * * /usr/bin/rsm/samplesMonitor.py 2>&1 >> /tmp/script.log
    

* * *

**Update 2:** I re-read your question and it acurred to me that maybe you are
running into python import issues. You say that your script calls two other
scripts. My suggestion would be to test running your script from `/`. Python
has a default behavior to find imports in the current working directory, so
make sure your script can run from any path location.

In the crontab, you can set the starting working directory by calling your
script from within another shell process. For example:

    
    
    bash -c "cd THE_WORKING_DIR;/usr/bin/rsm/samplesMonitor.py"
    

