Announcement

Collapse
No announcement yet.

run a script as root evry 30 mins

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    run a script as root evry 30 mins

    hi all i need to run a script evry 30 mins as root.

    the problem is the system gets shut down at 1pm evry nite.

    cron is useless and anacron do it once a day at random.

    is there any other solutions?.

    im running Kubuntu 20.0.4

    Sent from my POT-LX1 using Tapatalk
    Tutorials:
    Yoda's ownCloud Installation on Kubuntu 20.04

    #2
    cron is designed precisely for this and it is not useless, except maybe if you don't know how to use it.

    man cron

    Please Read Me

    Comment


      #3
      Originally posted by oshunluvr View Post
      cron is designed precisely for this and it is not useless, except maybe if you don't know how to use it.

      man cron
      but what happens when the system reboots?

      Sent from my POT-LX1 using Tapatalk
      Tutorials:
      Yoda's ownCloud Installation on Kubuntu 20.04

      Comment


        #4
        Originally posted by hightokeinyoda View Post
        hi all i need to run a script evry 30 mins as root.

        the problem is the system gets shut down at 1pm evry nite.

        cron is useless and anacron do it once a day at random.

        is there any other solutions?.

        im running Kubuntu 20.0.4

        Sent from my POT-LX1 using Tapatalk
        You can't run anything IF your system is shut down. While your system is running cron is a system process (daemon) running all the time and checks the crontab to see if it needs to do anything. Read the cron manual (man cron) to see how to create your own entries or crontabs.
        "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
        – John F. Kennedy, February 26, 1962.

        Comment


          #5
          Originally posted by hightokeinyoda View Post
          hi all i need to run a script evry 30 mins as root.
          That's what cron and anacron are for, but they have lots of gotchas. As far as I can remember, the randomness can be configured.

          Originally posted by hightokeinyoda View Post
          the problem is the system gets shut down at 1pm evry nite.
          Do you mean 1 am? 1 pm is about the middle of the day (usually).

          The computer's firmware (often called the BIOS, even on UEFI systems) might have "wake up" settings, which will power it up when you want it to.

          systemd surely does this kind of thing (it tries to do everything, one system to bring them all and in the darkness bind them ).
          Regards, John Little

          Comment


            #6
            thanks guys got it nailed turned out i was fudgeing my cron syntax.

            changed my mind and set it to do the task evry hour and every 30 minutes.

            now it works like a charm

            Sent from my POT-LX1 using Tapatalk
            Tutorials:
            Yoda's ownCloud Installation on Kubuntu 20.04

            Comment

            Working...
            X