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

Url Table - force update

Scheduled Pinned Locked Moved Firewalling
6 Posts 2 Posters 1.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.
  • M
    marcvb
    last edited by Mar 6, 2018, 12:33 PM

    Hello,

    We want to force an update of the url table each 5 minutes.

    We have changed the cron job /usr/bin/nice -n20 /etc/rc.update_urltables to: */5 * * * *
    But it seems there is also an age check of the file.

    Bellow is inside the rc.update_urltables, is it posible to always force?
    Maybe something like /usr/bin/nice -n20 /etc/rc.update_urltables forceupdate

    // Set whether or not to force the table update before it's time.
    if (!empty($argv[2]) && ($argv[2] == "forceupdate")) {
    $forceupdate = true;
    } else {
    $forceupdate = false;
    }

    1 Reply Last reply Reply Quote 0
    • V
      viragomann
      last edited by Mar 6, 2018, 2:07 PM

      The file age is checked by /etc/inc/pfsense-utils.inc

      In version 2.4.2 down the line 2501:

      	// If the file doesn't exist or is older than update_freq days, fetch a new copy.
      	if (!file_exists($urltable_filename) || (filesize($urltable_filename) == "0") ||
      	    ((time() - filemtime($urltable_filename)) > ($freq * 86400 - 90)) ||
      ...
      
      

      The tables are updated by default if the source files are older than 86400 - 90 seconds.

      A time ago I used this to set an individual update interval only for a specific table.

      However, if you update your pfSense you have to modify that file again after.

      1 Reply Last reply Reply Quote 0
      • M
        marcvb
        last edited by Mar 8, 2018, 9:39 AM Mar 7, 2018, 11:03 AM

        For now i edit the cron to  /usr/bin/nice -n20 /etc/rc.update_urltables now forceupdate
        Or is this a bad thing to do ?

        Does someone know if a url table can also collect description information from the txt?

        1 Reply Last reply Reply Quote 0
        • M
          marcvb
          last edited by Mar 15, 2018, 9:12 AM

          The above does not seems to work, i also tryed to copy the scrypt: /etc/rc.update_urltables and add unlink("/var/db/aliastables/blacklist.txt");
          And create a cron job for it without succes.

          1 Reply Last reply Reply Quote 0
          • V
            viragomann
            last edited by Mar 15, 2018, 11:03 AM

            You have to change both, of course, the interval of the cron job and the file age in the /etc/inc/pfsense-utils.inc script.

            However, this would change the update frequency for all tables! I suggest to build in a decision into the script to apply the shorter interval only for the one table you need it.

            1 Reply Last reply Reply Quote 0
            • M
              marcvb
              last edited by Mar 15, 2018, 3:07 PM

              There is no directory aliastables in /var/db/ could it be this system is broken and nobody noticed it ?

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                [[user:consent.lead]]
                [[user:consent.not_received]]