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

    Is it possible to schedule a command with pfSense?

    Scheduled Pinned Locked Moved General pfSense Questions
    14 Posts 5 Posters 14.4k 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.
    • S
      sullrich
      last edited by

      You have to restart cron.

      killall cron ; cron

      1 Reply Last reply Reply Quote 0
      • H
        hoba
        last edited by

        mpd handles pppoe and pptp as well.

        1 Reply Last reply Reply Quote 0
        • M
          MuDvAyNe
          last edited by

          Well, I have been screwing around with my Cron settings and here is what I came up with.

          I was able to perform a successful reboot of pfSense by adding this line:

          30	4	*	*	6	root	shutdown -r now
          

          So, I think this is pretty simple and I should be able to handle this without problems. It takes care of
          an occasionally wanted/needed auto reboot.

          I like hoba's idea of just dropping the DSL connection and bringing it back up, but with JUST the
          command he provided below, I can only get it to DROP the connection. What tells it to reconnect?

          *	4	*	*	*	root	killall mpd && /usr/local/sbin/mpd -b -d /var/etc/ -p /var/run/mpd.pid pptp
          

          I saw that you posted the killall cron ; cron but I don't know what to do with this or
          how it would reconnect my DSL. I guess it restarts the CRON service but doing this doesn't get me back online. I tried running it before and after running the above command, but my DSL connection just stays down.

          So…. ;D....I started screwing around looking for what would reconnect the DSL, and I think I am going
          to get slapped for this, but it seems to bring the connection back up.

          I ran this file two mins after hoba's command.

          2	4	*	*	*	root	etc/rc.reload_interfaces
          

          This apparently reloads all of my connections (like a World War 2 carpet bombing) and gets me backonline. My question is, is there a BETTER way to just bring the PPPOE back up without have to reload ALL interfaces? Before you hurt me, I am a dreaded Windows user that is at least trying to understand this FreeBSD stuff. I feel like I was dropped off in the middle of Bejing with no tour guide. It is all Chinese to me.

          9-30-06
          I found out the hard way that if you update your SNAPSHOT to a newer version, it wipes out your custom CRONTAB settings. So I am now making a backup of this file.
          Another side note, I read somewhere that in order for the CRONTAB file to execute properly, there needs to be a full BLANK line after the last command. If you look at the file BEFORE you edit it, you will see what I am talking about. I think this may have been what caused my commands to not work the first time.


          pfSense v 1.2-Release
          PII 350 256MB RAM
          HD Installed
          Cable Internet Connection
          LAN/WAN/DMZ
          Outbound Rules
          Inbound NAT

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

            I have tested this, reconnects pppoe wan connection at 5 o'clock in the morning:

            1. edit crontab
            webGUI >> Diagnostics >> Edit File: /etc/crontab

            *       5       *       *       *       root    killall mpd ; sleep 5 ; /usr/local/sbin/mpd -b -d /var/etc/ -p /var/run/mpd.pid pppoe
            

            (look at look at GUI >> Diagnostics >> Command Prompt: "ps ax | grep mpd")

            2. restart cron
            webGUI >> Diagnostics >> Command Prompt:

            killall cron ; cron
            

            Just thought this comment would be usefull, maybe this safes time for some pfBuddies…

            1 Reply Last reply Reply Quote 0
            • H
              hoba
              last edited by

              Daniel S. Haischt has kindly integrated this feature in the gui. Download the following Patchfile for Version 1.0.1: http://www.pfsense.com/~dsh/updates/pppoe-reset-embedded.tgz

              You can feed it as firmwareupgrade through the webgui.

              After that you can configure the ppoe reset at interfaces>wan, pppoe area "periodic reset".

              Please give us some feedback so we can include this feature in one of the next releases.

              1 Reply Last reply Reply Quote 0
              • M
                MuDvAyNe
                last edited by

                I have been running my pfSense with pixeldoc2000's crontab setting for about a week now and it is working flawlessly. Thank you very much for this.

                I am downloading the "patch" and will try that using the GUI.

                Just a question, is the "patch" just incorporating pixeldoc2000's crontab settings into the web interface? Or is this a totally different way of restarting the PPPOE?
                I am assuming that I will have to remove pixeldoc2000's command from my crontab.


                pfSense v 1.2-Release
                PII 350 256MB RAM
                HD Installed
                Cable Internet Connection
                LAN/WAN/DMZ
                Outbound Rules
                Inbound NAT

                1 Reply Last reply Reply Quote 0
                • M
                  MuDvAyNe
                  last edited by

                  The uploaded image file is not for this platform (pfSense).  :'(

                  This is what I get when I try to upload this patch through the firmware update.

                  I was thinking of just manually extracting the files and uploading them to my firewall via WinSCP
                  but I would like a second opinion before I blow things up. Has anyone else been able to succesfully
                  perform this patch?


                  pfSense v 1.2-Release
                  PII 350 256MB RAM
                  HD Installed
                  Cable Internet Connection
                  LAN/WAN/DMZ
                  Outbound Rules
                  Inbound NAT

                  1 Reply Last reply Reply Quote 0
                  • S
                    sullrich
                    last edited by

                    If you are on a full installation then rename the file pfSense-update.tgz and try again.

                    1 Reply Last reply Reply Quote 0
                    • D
                      DanielSHaischt
                      last edited by

                      @MuDvAyNe:

                      Just a question, is the "patch" just incorporating pixeldoc2000's crontab settings into the web interface? Or is this a totally different way of restarting the PPPOE?
                      I am assuming that I will have to remove pixeldoc2000's command from my crontab.

                      Yes, your assumption is correct. You need to remove each crontab entry that tries to restart the  mpd daemon before using the firmware upgrade. Anything else would lead to multiple mpd related entries in your crontab, which is something you don't want.

                      Cheers
                      Daniel S. Haischt

                      Mit freundlichen Gruessen / With kind regards
                      DAn.I.El S. Haischt

                      1 Reply Last reply Reply Quote 0
                      • M
                        MuDvAyNe
                        last edited by

                        Thanks for the tip with the archive rename and the Crontab question. Worked just fine after I did that.

                        I will post any problems (if any) after I run it for a bit. This is a very nice feature that I have been looking
                        for for a while and would love to see it incorporated into a future build.


                        pfSense v 1.2-Release
                        PII 350 256MB RAM
                        HD Installed
                        Cable Internet Connection
                        LAN/WAN/DMZ
                        Outbound Rules
                        Inbound NAT

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