Thread: cron and c.out

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jun 2019
    Posts
    44

    cron and c.out

    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:

    Code:
    id1.txt = 1000000021
    id2.txt = 1000000323
    id3.txt = 1000000011
    The expected result for a complete run within 1 minute or within 24 hours would be:

    Code:
    id1.txt = 1000000022       <<-- this one works
    id2.txt = 1000000324
    id3.txt = 1000000012
    But no!

    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.

    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
    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.

    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
    Last edited by jc2020; 03-14-2020 at 06:07 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 0
    Last Post: 09-13-2012, 08:57 PM
  2. cron troubles
    By Annonymous in forum Linux Programming
    Replies: 6
    Last Post: 05-09-2012, 03:51 PM
  3. creating cron job
    By nitinmhetre in forum Tech Board
    Replies: 3
    Last Post: 12-29-2006, 10:16 AM
  4. Cron - for all you unix people
    By nickname_changed in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 01-03-2004, 11:52 PM

Tags for this Thread