Hello cboard,
My question(s) is more OS related than C because I’m trap at not knowing what CRON full capabilities are. I have 3 well crafted c-files (id1 - id3.out) that works standalone without a hitch. The only thing it does is add *1* to a big number in separate file of difference size numbers and save it for the next day. You may ask why I choose to play with big numbers?
Well that was what everyone was trying to do because c is limited to 256. A DATABASE will end up with more lines then that SO I dived in and got something working. For simplicity:
The expected result for a complete run within 1 minute or within 24 hours would be:Code:id1.txt = 1000000021
id2.txt = 1000000323
id3.txt = 1000000011
But no!Code:id1.txt = 1000000022 <<-- this one works
id2.txt = 1000000324
id3.txt = 1000000012
Only the first line works in CRON for me and it seem this is the way for many other who have the same type issue that I saw during my searches on google; 24/7 for many days. I learn a lot but could not figure a solution or the truth about cron.
What has thrown me off is ALL that I have read there is no simple statement that directly says *there is only ONE CRON per user; per system that can be run within 24 hours*. If this IS true, I would be one-step closer to throwing in the towel. If this is not the case could someone please make all of below work thru whatever fashion possible?
These are my cron statements. They do not including the other 20 or more ways I found while googling, and tried nearly all of them to oblivion:
I ran this in /var/cron/tabs/root. I also ran this directly in /etc/cron-tab. This is the example list and both methods burped the same result.
If my setting here are not correct, trust me; trying to be like Paul Simon, I tried all 50 ways but I got same result (it do-nothing for lines 2 and 3 but line one always works). You find this out by checking the cron.log. In cron.log it accually read line 2 and 3 but show nothing as output in those files.Code:00 0 * * * root /bin1/id1.out………. Midnight every minute
10 0 * * * root /bin1/id2.out………. Midnight every 10 minute
20 0 * * * root /bin1/id3.out………. Midnight every 20 minute
Each of them is suppose to increase a big numbers by one… I hope I presented enough information/ideas about my situation that can lead to a solution.
Have a Great day!
PS:
This is all about:
How to Automate INSERT_INTO using C?
As you see, the only showstopper is that you lose the ability to include a continuous id INT field in mysql when using Automated INSERT_INTO or whatever it is call. Now here comes cron to not be who I thought he was :(
I hope I have missed something because this should not had happen.
Sorry for taking so long