Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cron help #2

Status
Not open for further replies.

Joe689

Technical User
Oct 1, 2003
6
0
0
US
I finnaly was able to get the cron to run my command every hour by

01 */1 * * * admin python /home/admin/zoneclient.py ...[snip]...

The snip represents Jlee40 ****** leecomp.us, the personal login information.

However every hour i get a email my cron saying,

sh: zoneclient.tmp: Permission denied
Traceback (innermost last):
File "/home/admin/zoneclient.py", line 3410, in ?
_main(sys.argv)
File "/home/admin/zoneclient.py", line 3073, in _main
fp = open(Tempfile, "r")
IOError: [Errno 2] No such file or directory: 'zoneclient.tmp'

The zoneclient.tmp is the file that zoneclient.py writes the current ip in. It reads like this

ppp0 Link encap:point-to-Point Protocol
inet addr:129.44.154.208 P-t-P:10.15.1.1 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:155 errors:0 dropped:0 overruns:0 frame:0
TX packets:178 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10
I dont understand whether the email is telling me that it cant find the file or that permission was denied to write. It is chmoded as -rw-r--r-- and root as the owner. I would appreciate any insight.
 
I'm not a Python programmer but it looks to me like that permission was denied to write. Check the permissions on the directory where the temporary file is being created.

HTH

:)
 
Smack yourself for this one. ;-)

You have only given superuser 'root' write access.

You are running the python script via cron as user 'admin'.

User 'admin' cannot write to the file/path, only user 'root'.

Change your perms to allow 'admin' to write or change your cron user for launching the script to 'root'.

"Surfinbox Shares" - A fundraising program that builds revenue from dialup Internet users.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top