Crontab Permissions Issue with Python


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Crontab Permissions Issue with Python
# 1  
Old 04-24-2010
Crontab Permissions Issue with Python

I have a cron on a Linux server that isn't executing properly.
CRON (with specific info replaced):

Code:
MAILTO=emailaddress@server.com
*/2 * * * * python /data/site/cron.py



OUTPUT:

Code:
python: can't open file '/data/site/cron.py
': [Errno 2] No such file or directory

Additional info
- The python path is correct
- Cron is a root cron
- Cron format is correct and the cron runs every 2 minutes as specified, but gets the error 'cannot open file'
- the command "python /data/site/cron.py" runs fine in the shell
- SELinux is turned off
- File permissions for cron.py are 777

I've tried everything that I can think of. Any ideas why the cron does not see the file?
# 2  
Old 04-24-2010
Check with the permissions

# cat /etc/cron.d/cron.deny
daemon
bin
smtp
nuucp
listen
nobody
noaccess
# 3  
Old 04-24-2010
Is it trying to open the filename with an appended newline? Note the closing quote around the filename in the error message begins on a second line.

Regards and welcome to the forum,
Alister
# 4  
Old 04-24-2010
Issue Resolved

cron.deny was empty.

It was the new line character issue.

I used crontab -e and pasted it in manually instead of reading from a text file (crontab cron.txt) and it runs.

I put the linebreak in on purpose (to avoid EOF error) Maybe it was saved with the wrong encoding or had /r/n or something.

Anyway, it's working like a champ now!

Thanks for your help, this forum is awesome!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

CRONTAB - one python script is not running

Hi! I'm using a RaspberryPi with standard Raspbian. Currently I'm working on some sort of weather station. For now I have three python scripts - one which is updating txt files for website - update1m.py ( it will not be necessary in few next days so I'll delete it) , second one for updating... (4 Replies)
Discussion started by: bartocham
4 Replies

2. Shell Programming and Scripting

To check the file permissions using python scripting

Hi, For a particular set of files, am trying to check if they are writable. i.e., checking whether they are having permissions greater than 755. Am able to check this using the statement: "if (os.path.isfile(FILE_PATH) and (os.stat(FILE_PATH).st_mode & 0777) == 0777):" But the problem... (1 Reply)
Discussion started by: arjun_arippa
1 Replies

3. Programming

To check the file permissions using python scripting

Hi, For a particular set of files, am trying to check if they are writable. i.e., checking whether they are having permissions greater than 755. Am able to check this using the statement: "if (os.path.isfile(FILE_PATH) and (os.stat(FILE_PATH).st_mode & 0777) == 0777):" But the problem here... (0 Replies)
Discussion started by: arjun_arippa
0 Replies

4. Solaris

Permissions issue

Hello, I'm having an issue with a directory that is used to forward Windows logs. I have a user account on Windows servers that uses SCP to put logs on my Solaris 10 server. A appliance called LogLogic then takes the logs from my server and stores them. I need to have have group read so the... (8 Replies)
Discussion started by: bitlord
8 Replies

5. Shell Programming and Scripting

Permissions issue

Hi, I have a shell script which calls oracle procedure. Procedure creates a file using oracle utl_file and places file on unix server at loaction /tmp. The file permission is getting set to 640 (Owner=oracle, group=dba) I need it to be 644 by default. (So others can read it.) The umask... (4 Replies)
Discussion started by: krishna_gnv
4 Replies

6. Shell Programming and Scripting

Permissions Issue

Hi Experts, I have one ftp user which will FTP the files to two subdirectories of some other user. Say i have one user "xyz" . It FTP's the file to the directory of "abc" user. I have added xyz user in abc group. -rw-r--r-- 1 xyz abc 0 Jul 26 10:05 mo -rw-r--r-- 1 xyz abc ... (1 Reply)
Discussion started by: sugarcane
1 Replies

7. Solaris

finding crontab and permissions

hi , how/where to find crontab and permissions that whether my user id has crontab permissions or not . I need to schedule one job through one application(datastage application) which is installed on sunsolaris envirobnment. When i try to schedule job/s, i am getting error that "Error... (3 Replies)
Discussion started by: sridhardwh
3 Replies

8. UNIX for Dummies Questions & Answers

python and crontab

Hi all, I have a cron job defined in my crontab to execute once every day. This works perfectly fine on my local installation. However for some reason the job never runs on the actual server. Below are my crontab entires in my local crontab and server crontab respectively 0 10 * * * cd... (2 Replies)
Discussion started by: vamsy
2 Replies

9. Linux

permissions issue

We are trying to run a program on a Red Hat ES3 machine that works fine under root user but not as any other user. I believe its getting denied access to the USB ports (which this program needs), Does anyone know how i can open up access to the USB ports on a machine to all users. Thanks, Frank (0 Replies)
Discussion started by: frankkahle
0 Replies

10. UNIX for Advanced & Expert Users

Python and Crontab

Hi, I am running a Python program using crontab as follows: * * * * * /home/usernine/metriculate.py But I keep getting an error: import: unable to open X server The following is what was in my mail on execution of crontab: X-Cron-Env: <SHELL=/bin/sh> X-Cron-Env:... (7 Replies)
Discussion started by: davidfrank
7 Replies
Login or Register to Ask a Question