Calling a PHP script from cron


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Calling a PHP script from cron
# 8  
Old 06-06-2004
When run from the command prompt, it says it can't open the file that I'm trying to move in the script.

BUT if i CD to /home/users/ElburdNDL/www/cgi-bin and THEN run the script, it's fine.

The file to be moved is in the cgi-bin.

Ed
# 9  
Old 06-06-2004
Then the script you are referring to seems to be not that well written. A really good script should not really care from which directory it is invoked and still does its job properly.

If the script can't be fixed to function that way, or it's supposed to be only invoked this way, the only way left is to invoke instead by

Code:
cd /home/users/ElburdNDL/www/cgi-bin && perl script.pl

If this works on the command line, just paste this onto your cron line.
# 10  
Old 06-06-2004
Working now, many thanks!

E
# 11  
Old 06-06-2004
Is the /home/... in your PATH? If not, add it.

Last edited by google; 06-06-2004 at 11:24 AM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Calling bash script works when called manually but not via Cron?

Hi, I've got a Bash backup script I'm trying to run on a directory via a cron job nightly. If I ssh in and run the script manually it works flawlessly. If I set up the cron to run evertything is totally messed up I don't even know where to begin. Basically the path structure is ... (6 Replies)
Discussion started by: wyclef
6 Replies

2. Web Development

Permission problems calling Ruby from php script

I'm just getting my feet wet with web development, so hopefully this is a simple thing I'm overlooking, but so far I'm stumped. I have a php script that calls Ruby via exec(). This works fine in my test environment, but when I moved it to my production environment I run into a permissions... (7 Replies)
Discussion started by: dantes990
7 Replies

3. Shell Programming and Scripting

calling a php file from perl script..

Hi am new to perl script .. i need some useful tutorials links to learn perl script.. and a sample script to call a php file from perl script.. thanks.. (3 Replies)
Discussion started by: senkerth
3 Replies

4. Shell Programming and Scripting

calling expect script in ksh is failing via cron

I'm calling an expect script via a ksh script in cron and it is failing. The script runs fine if i run it manually. Does anyone know if it is an issue with compatibilty and if there is a way around it? (2 Replies)
Discussion started by: bhatia
2 Replies

5. Shell Programming and Scripting

Calling php from shell script

Maybe someone here can help out. I have a script cat <somefile> | while read hostname do /usr/bin/php <some php script> $hostname done This script works great for the first entry in the host list. However it will only execute and ignores the loop part. It's almost as if it loses... (4 Replies)
Discussion started by: dbakyle
4 Replies

6. Shell Programming and Scripting

Calling an Expect script from a Webpage using PHP

I have a webpage that is in HTML and PHP. In PHP I have tried using exec, system, shell_exec and passthru functions to call an Expect Script file (temp.exp). This Expect file spawns a telnet session that uses "expect/send" commands to retrieve information from an environmental unit (not a normal... (0 Replies)
Discussion started by: CCUSmith
0 Replies

7. Shell Programming and Scripting

Calling a shell script from php

Hi, I have a shell script and I'm trying to execute it from my php script. The command I'm using is: shell_exec("Script.sh"); Is this correct? It seems to not do anything for me. Not sure if this might be a permission issue or not. I have both scripts 777 permissions. Maybe I got the... (1 Reply)
Discussion started by: eltinator
1 Replies

8. UNIX for Dummies Questions & Answers

Questions about cron and php script

I'm trying to set up a php script that runs via crontab on a server. I've never done anything like this before. My questions: 1) I want the crontab to run the script everyday from 3:58 PM to 4:13 PM EST. How is that written in crontab? 2) The command I want crontab to run is: php -q... (3 Replies)
Discussion started by: colin72
3 Replies

9. Shell Programming and Scripting

Issue calling scripts through CRON.

I have the following cron job in the crontab. #! /bin/bash 25 15 * * 1-5 /export/home/svittala/scripts/scpt1.sh >/dev/null 2>&1. The problem that I am facing is - the scpt1.sh can be executed manually. But, it is not executing through CRON. Not sure what's the issue. Any hints?. Thanks.... (5 Replies)
Discussion started by: vskr72
5 Replies

10. Shell Programming and Scripting

java errors when calling from cron

I am more or less new to using cron, and I am trying to automate a log cleaning system I have made. The system basically cleans through WWW logs that are mounted on an NFS and creates text files for entry into a local PostgreSQL DB. For the past year I have been running the various scripts and... (3 Replies)
Discussion started by: mntamago
3 Replies
Login or Register to Ask a Question