Executing a cronjob at n minutes after the hour

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mdburton
    New Member
    • Mar 2007
    • 15

    Executing a cronjob at n minutes after the hour

    I don't knwo if this is the correct forum, but ill assume so since it is running php scripts ; )


    Anyways I need a script to run every 10 mins on the 5, so :05, :15, :25,:35,:45,:55

    I know the syntax for running every 10 mins on the 10 is */10, but how do i make it do it on the 5? or 8 = )

    maybe it isn't possible to do them all with one command I just don't want to clutter up my cronjobs with things that can be done with one line instead of 6
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Changed thread title to better match contents (hm... shoulda proofed that before I moved it out of a forum where I have mod privileges :P).

    I'm going to move this thread to the shell scripting forum where it will receive more relevant exposure.

    Comment

    • mdburton
      New Member
      • Mar 2007
      • 15

      #3
      sorry wasnt sure what forum = )

      anyways anyone have a clue? = )

      Comment

      • arne
        Recognized Expert Contributor
        • Oct 2006
        • 315

        #4
        Originally posted by mdburton
        I don't knwo if this is the correct forum, but ill assume so since it is running php scripts ; )


        Anyways I need a script to run every 10 mins on the 5, so :05, :15, :25,:35,:45,:55

        I know the syntax for running every 10 mins on the 10 is */10, but how do i make it do it on the 5? or 8 = )

        maybe it isn't possible to do them all with one command I just don't want to clutter up my cronjobs with things that can be done with one line instead of 6
        You can of course always go for the simple solution: "8,18,28,38,48, 58" (one line!), but you could also try with ranges (they can be combined with skipping), so something like "8-58/10". Don't know if that works, though ... try it and let us know :-)

        arne

        Comment

        • coaxfiber
          New Member
          • Mar 2007
          • 60

          #5
          Hi,

          Is it possible to insert a job using "./ksh" while all current jobs are using "./csh"


          Thanks...

          BR,
          -coaxfiber

          Comment

          • prn
            Recognized Expert Contributor
            • Apr 2007
            • 254

            #6
            Originally posted by coaxfiber
            Hi,

            Is it possible to insert a job using "./ksh" while all current jobs are using "./csh"


            Thanks...

            BR,
            -coaxfiber
            This question really is not related to the original, so it ought to be in a new thread of its own.

            However, the answer to the question is yes. You do it the same way you specify the interpreter for any script -- in the first line:
            Code:
            #! /bin/ksh
            Then when you run the script, or refer to it in your crontab, ksh will be used to run the remainder of the script.

            HTH,
            Paul

            Comment

            • coaxfiber
              New Member
              • Mar 2007
              • 60

              #7
              Thank You Very Much!!!

              Best Regards,
              -coaxfiber

              Comment

              • mdburton
                New Member
                • Mar 2007
                • 15

                #8
                8-58/10

                that worked out it seems

                thanks for the help!!! = )

                Comment

                • arne
                  Recognized Expert Contributor
                  • Oct 2006
                  • 315

                  #9
                  Originally posted by mdburton
                  8-58/10

                  that worked out it seems

                  thanks for the help!!! = )
                  Thanks for letting us know!

                  arne

                  Comment

                  Working...