strange cron problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dannyd
Forum Commoner
Posts: 56
Joined: Wed Jan 23, 2008 11:31 am

strange cron problem

Post by dannyd »

I wrote a script that parses a file and inserts the data into a database. If I run the script once it works fine. However if I run the script while data is in the database nothing gets inserted.

Anyone know what the problem might be ?
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Re: strange cron problem

Post by Zoxive »

Easiest way is to look at the mysql error you would be getting.

Most likely a unique row, or something similar.
kryles
Forum Contributor
Posts: 114
Joined: Fri Feb 01, 2008 7:52 am

Re: strange cron problem

Post by kryles »

yah, check Primary Key or Unique columns to make sure there are no duplicate entries
dannyd
Forum Commoner
Posts: 56
Joined: Wed Jan 23, 2008 11:31 am

Re: strange cron problem

Post by dannyd »

Actually I used a replace into. The script runs fine when I run it on the command line:

$> php -a ./logs

I entered a line in the crontab file

5 10 *** /usr/local/cron/logs // to run at 10:05am

I changed the time to see if it would run but nothing happens. Any ideas ?
dannyd
Forum Commoner
Posts: 56
Joined: Wed Jan 23, 2008 11:31 am

Re: strange cron problem

Post by dannyd »

My problem is the cron works on the commandline but doesnt work as a crontab.

apparently the problem is setting environment variables from what I've read. How do I do that ?
Post Reply