randomise cron jobs

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Pari123
    Junior Member
    • Jun 2005
    • 20

    #1

    randomise cron jobs

    Hi all,

    I currently run a cron to post to my wordpress blog and would like to know how to actually set the time to post at random intervals and not at the same time each day.

    I set the cron up through cpanel, but there is no option but to choose a set time.

    Can anyone help I can overcome this please?

    thanks Pari
    Last edited by Pari123; 11-05-2005, 05:19 PM.
  • sdjl
    Senior Member
    • Mar 2004
    • 502

    #2
    Unfortunately, you have to tell cron exactly when you want to run something.
    You could setup multiple cron's to post at different times on different days but as far as i'm aware, there's no way of randomising it.

    David
    -----
    Do you fear the obsolescence of the metanarrative apparatus of legitimation?

    Comment

    • james
      Senior Member
      • Mar 2004
      • 183

      #3
      You could modify the php script that runs at a specific time to subtract a random amount of time from the date before publishing your post.

      This way it would appear as if the times are more random.

      James

      Comment

      • Pari123
        Junior Member
        • Jun 2005
        • 20

        #4
        randomising cron jobs

        thanks James,

        Are you able to advise on the php script as I am not a programmer please?

        thanks Pari

        Comment

        • james
          Senior Member
          • Mar 2004
          • 183

          #5
          It would involve using the PHP rand() function.

          Are you able to send me the PHP script that you are currently using for the cron jobs - I may have time to edit it for you.

          How much would you want the date/time to vary by? Up to 12 hours either way I would assume?

          Cheers,

          James

          Comment

          • Pari123
            Junior Member
            • Jun 2005
            • 20

            #6
            cron jobs

            Thanks James,

            I currently use the simple option for setting up crons. And yes, I would like my cron jobs to be randomised from anywhere between 6-12 hours apart.

            The commant I use is

            GET http://www.trainer-offers.info/wp-co...ibboleth=hello

            thanks Pari

            Comment

            • james
              Senior Member
              • Mar 2004
              • 183

              #7
              Do you have access to the source code of that script?

              I would need to see the code in order to modify it.

              Feel free to PM it to me and I'll check it out.

              James

              Comment

              • Pari123
                Junior Member
                • Jun 2005
                • 20

                #8
                cron jobs

                James,

                Not sure how I can get that. All I do is go into CPANEL and choose cron jobs and then there is an option for stanard or unix cron jobs. I then choose the standard option and type GET and whatever file I need to run.

                hope that helps

                thanks Pari

                Comment

                • james
                  Senior Member
                  • Mar 2004
                  • 183

                  #9
                  Hmm I'm all out of ideas then.

                  The only way I could think to "randomise" it was to edit the script's code.

                  Sorry.

                  Comment

                  • blakekr
                    Member
                    • Dec 2004
                    • 30

                    #10
                    James, would you mind giving a rough overview of how you would go about it? I'd love to integrate what you describe into wp-mail (wordpress email to blog script), but don't know where to start.

                    Comment

                    Working...