Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Cron job to power off pfSense?

    Scheduled Pinned Locked Moved Off-Topic & Non-Support Discussion
    6 Posts 3 Posters 2.6k 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
                • First post
                  Last post
                Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.