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

    Schedule Shutdown

    Off-Topic & Non-Support Discussion
    2
    12
    20.4k
    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.
    • ?
      Guest
      last edited by

      Well, i'm thinking about shutting down my pfsense everynight at 11:45.  Is that possible?

      1 Reply Last reply Reply Quote 0
      • Cry HavokC
        Cry Havok
        last edited by

        Yes.  It looks like cron is running on 1.2 so you could put in a cron job to run "halt -p".

        Two things though:

        1. Make sure your host powers off, otherwise you'll still be using power, but doing nothing.

        2. Most hardware fails at power on.  You'll potentially be reducing the lifespan of your system considerably.

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

          @Cry:

          Yes.  It looks like cron is running on 1.2 so you could put in a cron job to run "halt -p".

          Two things though:

          1. Make sure your host powers off, otherwise you'll still be using power, but doing nothing.

          2. Most hardware fails at power on.  You'll potentially be reducing the lifespan of your system considerably.

          So is it better to leave my system on 24/7 as i'm doing now? I was just thinking of saving energy that's all.  Thanks.

          1 Reply Last reply Reply Quote 0
          • Cry HavokC
            Cry Havok
            last edited by

            "It depends".

            You need to look at your overall cost and convenience.  How much does it cost you to run it?  How long will it take to pay back the cost of a replacement hard disk?  Would it be more cost effective to replace it with a lower power system?

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

              This is for Clarkconnect but i was wondering if it will work on pfsense or do i have to modify it a little?  Please let me know.  Thanks.

              Automatic system shutdown
              To set you system to shutdown automatically you can create a 'cronjob' to closed down the system. (My Via ITX motherboard supports auto power-on through the BIOS, so I can set it to power up first thing in the morning).
              
              Note:- I don't use this anymore, I leave the server powered up 24 hours a day, the power usage is negligible, its silent when idle and it auto-updates the system in the early hours of the morning.
              
              Login with PuTTY and enter:
              
              crontab -e
              
              You will be presented with the vi editor (which isn't very friendly)...
              
              Press the 'a' key to enter the text mode
              
              Enter the following line:
              
              45 22 * * * /sbin/shutdown -h now
              
              Return to the command line by pressing 'Esc' key
              
              Save the file by entering:
              
              :w
              
              Exit the editor by entering:
              
              :q
              
              To check the file enter:
              
              crontab -l
              
              The above example shuts the system down at 22:45 (10:45pm), adjust the values to suit your requirements
              
              

              I found this at: http://www.ulverston.myzen.co.uk/mini-itx/pages/tuning.htm#Automatic_system_shutdown

              1 Reply Last reply Reply Quote 0
              • Cry HavokC
                Cry Havok
                last edited by

                As I said, use "halt -p".  pfSense is based on FreeBSD, ClarkConnect is based on Linux.  There are some significant differences ;)

                Otherwise, yes.  Just check timezones (type "date" at the command line) to ensure you shut it down when you expect.

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

                  I was wondering what to use on midnight time.

                  A. 00
                  B. 0
                  C. 24

                  Kinda confusing.

                  1 Reply Last reply Reply Quote 0
                  • Cry HavokC
                    Cry Havok
                    last edited by

                    There is no 24:00 ;)

                    Use either 00 or 0, either will work.  I strongly recommend you make use of the man pages (the FreeBSD man pages are available online).

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

                      Yeah, i've looked at the page but i believe i didn't find the time format.  I've tested using for example 45 17 and it work but when i use 45 0 it didn't turn off my pc, so i think i might have to use 00 double digit.

                      1 Reply Last reply Reply Quote 0
                      • Cry HavokC
                        Cry Havok
                        last edited by

                        If you specify it as:

                        45 0 * * * /sbin/halt -p
                        

                        Then it should shut down at quarter to one in the morning.  That format works on a standard FreeBSD host.

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post
                        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.