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

Schedule Shutdown

Scheduled Pinned Locked Moved Off-Topic & Non-Support Discussion
12 Posts 2 Posters 20.5k 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.
  • ?
    Guest
    last edited by May 20, 2009, 3:12 PM

    Hi everyone, how can i schedule pfsense 1.2.2 to shutdown at a current time? I know i have to moify something in crontab but not sure on how to do it the right way.  Can someone show me or give me the direction?  Thanks guys.

    1 Reply Last reply Reply Quote 0
    • C
      Cry Havok
      last edited by May 20, 2009, 4:41 PM

      If it's a one off event, try the at command.

      1 Reply Last reply Reply Quote 0
      • ?
        Guest
        last edited by May 20, 2009, 5:08 PM

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

        1 Reply Last reply Reply Quote 0
        • C
          Cry Havok
          last edited by May 20, 2009, 5:26 PM

          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 May 20, 2009, 5:55 PM

            @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
            • C
              Cry Havok
              last edited by May 20, 2009, 6:32 PM

              "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 May 20, 2009, 7:47 PM May 20, 2009, 7:45 PM

                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
                • C
                  Cry Havok
                  last edited by May 20, 2009, 8:36 PM

                  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 May 21, 2009, 3:05 PM

                    I was wondering what to use on midnight time.

                    A. 00
                    B. 0
                    C. 24

                    Kinda confusing.

                    1 Reply Last reply Reply Quote 0
                    • C
                      Cry Havok
                      last edited by May 21, 2009, 3:28 PM

                      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 May 21, 2009, 5:16 PM

                        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
                        • C
                          Cry Havok
                          last edited by May 21, 2009, 6:37 PM

                          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
                          12 out of 12
                          • First post
                            12/12
                            Last post
                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                            This community forum collects and processes your personal information.
                            consent.not_received