Url Table - force update
-
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;
} -
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.
-
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?
-
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. -
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.
-
There is no directory aliastables in /var/db/ could it be this system is broken and nobody noticed it ?