cron problem
Moderator: General Moderators
cron problem
My cron works on the command line but not as a crontab.
How can I get it working as a crontab ?
How can I get it working as a crontab ?
-
Mightywayne
- Forum Contributor
- Posts: 237
- Joined: Sat Dec 09, 2006 6:46 am
Re: cron problem
Erm, which OS are you using? For example in Plesk, you just go to the cron tab and deselect the command line option.
Re: cron problem
Fedora Core 4.
Re: cron problem
How are you executing it in command line & crontab?
Are you using shebang? Or Full path to php?
Are you using shebang? Or Full path to php?
Re: cron problem
Im using this at the top of the script:
#!/usr/local/bin/php -q
And this line to execute on the command line:
php -a ./logs
#!/usr/local/bin/php -q
And this line to execute on the command line:
php -a ./logs
Re: cron problem
theres other cron scripts working before I started fine.
Not sure exactly why mine only works on the command line and not using crontab.
Not sure exactly why mine only works on the command line and not using crontab.
Re: cron problem
when I run the cron on the command line it works fine .. but it also says Interactive mode enabled when I run it:
[root@web1 cron]# php -a ./logs
Interactive mode enabled
Processing the following files:<BR>080203log.txt
It doesnt work as a crontab. My crontab entry is fine to run at 10:20am.
20 10 * * * /usr/local/cron/logs
[root@web1 cron]# php -a ./logs
Interactive mode enabled
Processing the following files:<BR>080203log.txt
It doesnt work as a crontab. My crontab entry is fine to run at 10:20am.
20 10 * * * /usr/local/cron/logs
-
Mightywayne
- Forum Contributor
- Posts: 237
- Joined: Sat Dec 09, 2006 6:46 am
Re: cron problem
Your host will more than likely know how to help you.
Re: cron problem
I dont have a host. Im on my own managed server.
Re: cron problem
Mar 6 11:57:01 intranet crond[2286]: (tmp.XXXXGHJVjz) ORPHAN (no passwd entry)
Mar 6 11:57:01 intranet crond[2286]: (root) RELOAD (cron/root)
Mar 6 11:57:01 intranet crond[2286]: (tmp.XXXXFqiL6E) ORPHAN (no passwd entry)
Anyone know what this means.
This is the error I get in my cron log file. I suspect its not running the file as root which it is supposed to. How can I set the user to run the cron job ?
Let me know if im wrong.
Mar 6 11:57:01 intranet crond[2286]: (root) RELOAD (cron/root)
Mar 6 11:57:01 intranet crond[2286]: (tmp.XXXXFqiL6E) ORPHAN (no passwd entry)
Anyone know what this means.
This is the error I get in my cron log file. I suspect its not running the file as root which it is supposed to. How can I set the user to run the cron job ?
Let me know if im wrong.
Re: cron problem
Figured it out:
1. 20 10 * * * /usr/local/bin/php -a /usr/local/cron/logs
2. restart crond
1. 20 10 * * * /usr/local/bin/php -a /usr/local/cron/logs
2. restart crond