Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Register
    • Login
    Introducing Netgate Nexus: Multi-Instance Management at Your Fingertips.

    Auto restart with cron.. How to do it?

    Scheduled Pinned Locked Moved General pfSense Questions
    9 Posts 6 Posters 14.8k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      jdwilliams
      last edited by

      I want to reboot the box everynight at 2 am..any idea how i can do this?

      1 Reply Last reply
      Reply Quote 0
      • F
        focalguy
        last edited by

        Install the cron package to make it easier to add cron jobs.

        The command seems to be /sbin/shutdown -p now
        Just add that as your command and root as the user like other jobs already in there.

        I haven't tested this though.

        1 Reply Last reply
        Reply Quote 0
        • J
          jamesdean
          last edited by

          Dont do a /sbin/shutdown -p now that just powers down the system.

          do a /sbin/reboot

          1 Reply Last reply
          Reply Quote 0
          • F
            focalguy
            last edited by

            You're right. I copied the line from a page where I found the full path for the shutdown command. I mean to change it to shutdown -r now which as far as I know will do the same as reboot but I may be mistaken.

            1 Reply Last reply
            Reply Quote 0
            • O
              orc4hire
              last edited by

              Yes, 'shutdown -r now' will do an immediate reboot.  You can replace 'now' with a number of minutes ('shutdown -r 5' for a reboot in five minutes, say) or an absolute time but you won't need that with a chron job.

              1 Reply Last reply
              Reply Quote 0
              • T
                Topell
                last edited by

                Why do you need to bounce the box every night?

                1U Pfsense Appliances.
                Topell com

                1 Reply Last reply
                Reply Quote 0
                • J
                  jdwilliams
                  last edited by

                  @Topell:

                  Why do you need to bounce the box every night?

                  Just to try and keep things running smooth…

                  Its for a user whos 300 miles away and they have some slowness issues after squid has been runing for a few days and the webcon give a 500 error at random.

                  1 Reply Last reply
                  Reply Quote 0
                  • ?
                    Guest
                    last edited by

                    So you're slapping a horrible bandage on the problem rather than addressing it?

                    1 Reply Last reply
                    Reply Quote 0
                    • O
                      orc4hire
                      last edited by

                      @jdwilliams:

                      @Topell:

                      Why do you need to bounce the box every night?

                      Just to try and keep things running smooth…

                      Its for a user whos 300 miles away and they have some slowness issues after squid has been runing for a few days and the webcon give a 500 error at random.

                      Do you normally work with Windows?

                      1 Reply Last reply
                      Reply Quote 0

                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                      With your input, this post could be even better 💗

                      Register Login
                      • First post
                        Last post
                      Copyright 2026 Rubicon Communications LLC (Netgate). All rights reserved.
                      Privacy Policy · Cookie Policy