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

    Cron job to power off pfSense?

    Scheduled Pinned Locked Moved Off-Topic & Non-Support Discussion
    6 Posts 3 Posters 3.1k 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.
    • P
      pfSensible
      last edited by

      Every night to save energy I shut down the pfSense box, but I often forget.  Is there a cron job that can do this automatically?  What would the syntax be?

      thanks!

      edit
      I am going to take a crack at this (but I cannot test it now, must wait about 5 hours).

      /sbin/shutdown -h

      Is this correct?

      The NSA is a terrorist organization that must be stopped.

      1 Reply Last reply
      Reply Quote 0
      • R
        rjcrowder
        last edited by

        think there is an rc.shutdown script… (in /etc)

        1 Reply Last reply
        Reply Quote 0
        • P
          pfSensible
          last edited by

          @rjcrowder:

          think there is an rc.shutdown script… (in /etc)

          Yes, found it!  So the syntax would just be:

          /etc/rc.shutdown

          ?

          The NSA is a terrorist organization that must be stopped.

          1 Reply Last reply
          Reply Quote 0
          • R
            rjcrowder
            last edited by

            @pfSensible:

            @rjcrowder:

            think there is an rc.shutdown script… (in /etc)

            Yes, found it!  So the syntax would just be:

            /etc/rc.shutdown

            ?

            Believe so… just try it from the command prompt.

            1 Reply Last reply
            Reply Quote 0
            • P
              pfSensible
              last edited by

              OK, after hours I played with it and got it working.  This code powers off the pfSense:

              /sbin/shutdown -p now

              pfSense_cron_shutdown.PNG
              pfSense_cron_shutdown.PNG_thumb

              The NSA is a terrorist organization that must be stopped.

              1 Reply Last reply
              Reply Quote 0
              • V
                verigoth
                last edited by

                On FreeBSD the single word command is 'poweroff' (vs 'halt' on Linux). Just making a note for if anybody searches for this.

                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