We have a simple query and insert using C code linking to mysql db. The issue now on itself the script works fine. But when we put to run as a cron job the select query gives empty results and when we run back on the db there is results. It really puzzle as to what extra should be done for it to a cron job?
newbie14
0
Posting Pro
Recommended Answers
Jump to PostHello,
It is hard to tell what is wrong without seeing the cron entry you ae using or the code. However the first things that come to mind are that cron jobs are not run with the same environment variables as a normal user. You have to call the program …
Jump to PostRight, I was thinking 'permissions'. But rch1231 is correct. It's more likely the environment variables.
If you could post the cron entry and any important errors in the logs, that would be a big help.
Jump to PostHello,
I don't know enough about C programming to be able to tell you what to do there but I suggest that you try putting your variables into a shell script file with the c program called at the very end and call that program instead of the c file:
…
All 11 Replies
rch1231
169
Posting Shark
CimmerianX
197
Junior Poster
newbie14
0
Posting Pro
rch1231
169
Posting Shark
newbie14
0
Posting Pro
rch1231
169
Posting Shark
newbie14
0
Posting Pro
rubberman
1,355
Nearly a Posting Virtuoso
Featured Poster
newbie14
0
Posting Pro
rch1231
169
Posting Shark
newbie14
0
Posting Pro
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.