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

    More granular schedule?

    Scheduled Pinned Locked Moved General pfSense Questions
    8 Posts 2 Posters 1.0k 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
      pfpv
      last edited by

      I need to schedule something to 5 min precision in Schedules. For example from 9:05 to 9:55. Is there a way to do this? Is there a reason to have 15 min intervals only for schedules? I googled it and nobody discusses this, I am surprised.

      1 Reply Last reply Reply Quote 0
      • stephenw10S
        stephenw10 Netgate Administrator
        last edited by

        You can do it manually if you really need that. You can edit the schedule in the config and add more intervals to the cronjob.
        It's easy to overwrite that though if you edit and save it again in the gui.

        Steve

        P 1 Reply Last reply Reply Quote 1
        • P
          pfpv @stephenw10
          last edited by pfpv

          @stephenw10 Do you mean editing the config.xml? It crossed my mind but I rejected it as too dangerous. Last time I restored the config I had to fiddle with interface assignments. I am not sure if I have to do it if I only change schedules.

          Is it possible to edit only part of the config and then import/restore it?

          P.S. It looks like it is possible to backup and restore only parts of the config. I see that there are more options to restore than to backup. Maybe not all of them are defined on my machine. So, I backed up Scheduled Tasks but the config contains only cron schedules.

          Can you please point me in the right direction how I can backup, edit and restore Schedules?

          stephenw10S 1 Reply Last reply Reply Quote 0
          • stephenw10S
            stephenw10 Netgate Administrator @pfpv
            last edited by

            @pfpv said in More granular schedule?:

            Is it possible to edit only part of the config and then import/restore it?

            Yes, but I would always try to avoid it. It's almost always safer to import a complete config. If you do try that you must make sure the config version is the same. Partial config imports are not parsed by the updater.

            I would use the cron package to edit the filter reload job.

            Then edit the schedule in the config file.

            All of that is not without risk of course. Just use the 15m intervals to be safe.

            Steve

            P 1 Reply Last reply Reply Quote 1
            • P
              pfpv @stephenw10
              last edited by

              @stephenw10 Thanks. If I ever do this I will save the config and immediately modify and restore it, so it will be the same version.

              Your post confused me. Why are there options for partial backup and restore of the config if it is dangerous and not parsed by the updater? One can chose Backup area and Restore area with some granular choice.

              Can you please point me to which cron job I should edit? I don't see anything that either reloads filters or executes every 15 min. I looked in the GUI and in the config file. And I found <schedules> in the config file.

              Why is there a limit of 15 min intervals? Actually in the latest version three 15 min intervals and one 14 min, and one 1 min (:59 and :00 options). Can it be done in 1 min or 5 min intervals in general?

              stephenw10S 1 Reply Last reply Reply Quote 0
              • stephenw10S
                stephenw10 Netgate Administrator @pfpv
                last edited by

                @pfpv said in More granular schedule?:

                Why are there options for partial backup and restore of the config if it is dangerous and not parsed by the updater?

                You can do it if you need to but you just need to be aware of the possible issues when doing so.

                Only the system section contains the config version so if your restore file does not contain that the config updater cannot run against it.

                The cron job is only added when you enable a firewall rule with a schedule. You probably haven't done that yet.

                Cron can run every minute but reloading the filter at 1m intervals is significant load on the firewall. 15m intervals is a compromise that fits most use cases.

                Steve

                P 1 Reply Last reply Reply Quote 1
                • P
                  pfpv @stephenw10
                  last edited by

                  @stephenw10 said in More granular schedule?:

                  The cron job is only added when you enable a firewall rule with a schedule. You probably haven't done that yet.

                  🤦 (only a girly facepalm is available in the emoji section)
                  I was running rules with schedules for a long time but disabled them on Monday because it was a holiday and forgot about it. I enabled them and now I see the cron job /etc/rc.filter_configure_sync. What's interesting it's only 0,15,30,45. Some of my schedules start or end at :59.

                  Thanks for the help. I will see if I will be brave enough to restore config only for schedules. I am still not sure if it will ask me about interface assignments if nothing changed in the hardware. I guess I will find out.

                  1 Reply Last reply Reply Quote 0
                  • stephenw10S
                    stephenw10 Netgate Administrator
                    last edited by

                    It won't. It will only ask you to reassign the interfaces if the config file contains interfaces that don't exist in the system. That obviously won't be the case for you as you exported the config from that same system.

                    Steve

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