cron job wont stop
-
Using the pkg_check.php script seen in another forum post which checks for updated packages, i have it running just fine on one of my firewalls.
On the second firewall the exact same script keeps executing every minute. I double checked the corn job to ensure its set the same way on the working one which it is so I'm sort of at a lossWorking without issue.
Working with issue
I don't think it matters but the firewall working without issue is a 6100 and the one where the update script is running every minute is a 1100.
Any ideas?
-
What does the actual crontab file look like?:
[24.08-DEVELOPMENT][admin@4200.stevew.lan]/root: cat /etc/crontab # # pfSense specific crontab entries # Created: August 28, 2024, 12:56 pm # SHELL=/bin/sh PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin */1 * * * * root /usr/sbin/newsyslog 1 3 * * * root /etc/rc.periodic daily 15 4 * * 6 root /etc/rc.periodic weekly 30 5 1 * * root /etc/rc.periodic monthly 1,31 0-5 * * * root /usr/bin/nice -n20 adjkerntz -a 1 3 1 * * root /usr/bin/nice -n20 /etc/rc.update_bogons.sh 1 1 * * * root /usr/bin/nice -n20 /etc/rc.dyndns.update */60 * * * * root /usr/bin/nice -n20 /usr/local/sbin/expiretable -v -t 3600 virusprot 30 12 * * * root /usr/bin/nice -n20 /etc/rc.update_urltables 1 0 * * * root /usr/bin/nice -n20 /etc/rc.update_pkg_metadata * * * * * root /usr/bin/nice -n20 /usr/local/bin/php /usr/local/sbin/acbupload.php */5 * * * * root /usr/bin/nice -n20 /usr/local/bin/php -f /usr/local/pkg/snort/snort_check_cron_misc.inc # # DO NOT EDIT THIS FILE MANUALLY! # Use the cron package or create files in /etc/cron.d/. #
-
@michmoor said in cron job wont stop:
update script is running every minute is a 1100.
every minute? seems aggressive . more than once a day seems aggressive their won't be updates that often --
10 12 * * * blah
min hour dayofmonth monthofyear dayofweek
10th minute, in the 12th hour, every day of the month, every month of the year, ever day of the week.
for example
0 0 * * 0 blah
run at midnight every sunday
you can also do stuff like this
30 0,2,4,6,8,10,12,14,16,18,20,22 * * * blah
so run on the 30th minute of every even hour (so every 2 hours) of every day
etc.
-
It looks good to me
]/root: cat /etc/crontab # # pfSense specific crontab entries # Created: August 27, 2024, 6:38 pm # SHELL=/bin/sh PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin */1 * * * * root /usr/sbin/newsyslog 1 3 * * * root /etc/rc.periodic daily 15 4 * * 6 root /etc/rc.periodic weekly 30 5 1 * * root /etc/rc.periodic monthly 1,31 0-5 * * * root /usr/bin/nice -n20 adjkerntz -a 1 3 1 * * root /usr/bin/nice -n20 /etc/rc.update_bogons.sh 1 1 * * * root /usr/bin/nice -n20 /etc/rc.dyndns.update */60 * * * * root /usr/bin/nice -n20 /usr/local/sbin/expiretable -v -t 3600 virusprot 30 12 * * * root /usr/bin/nice -n20 /etc/rc.update_urltables 1 0 * * * root /usr/bin/nice -n20 /etc/rc.update_pkg_metadata 16 3 * * * root /usr/local/pkg/acme/acme_command.sh "renewall" | /usr/bin/logger -t ACME 2>&1 * * * * * root /usr/bin/nice -n20 /usr/local/bin/php /usr/local/sbin/acbupload.php 0 8 * * 5 root /usr/local/bin/php /usr/local/www/pfblockerng/pfblockerng.php dcc >> /var/log/pfblockerng/extras.log 2>&1 0 * * * * root /usr/local/bin/php /usr/local/www/pfblockerng/pfblockerng.php cron >> /var/log/pfblockerng/pfblockerng.log 2>&1 * 12 * * * root /usr/local/bin/php -q /root/pkg_check.php # # DO NOT EDIT THIS FILE MANUALLY! # Use the cron package or create files in /etc/cron.d/. #
In case you think i was joking about the spam
Aug 28 12:40:21 790CCV-FW php-cgi[90234]: notify_monitor.php: Message sent to admin@xxxxxxxx.com OK Aug 28 12:41:23 790CCV-FW php-cgi[90234]: notify_monitor.php: Message sent to admin@xxxxxxxx.com OK Aug 28 12:42:25 790CCV-FW php-cgi[90234]: notify_monitor.php: Message sent to admin@xxxxxxxx.com OK Aug 28 12:43:27 790CCV-FW php-cgi[90234]: notify_monitor.php: Message sent to admin@xxxxxxxx.com OK Aug 28 12:44:29 790CCV-FW php-cgi[90234]: notify_monitor.php: Message sent to admin@xxxxxxxx.com OK Aug 28 12:45:32 790CCV-FW php-cgi[90234]: notify_monitor.php: Message sent to admin@xxxxxxxx.com OK Aug 28 12:46:34 790CCV-FW php-cgi[90234]: notify_monitor.php: Message sent to admin@xxxxxxxx.com OK Aug 28 12:47:36 790CCV-FW php-cgi[90234]: notify_monitor.php: Message sent to admin@xxxxxxxx.com OK Aug 28 12:48:38 790CCV-FW php-cgi[90234]: notify_monitor.php: Message sent to admin@xxxxxxxx.com OK Aug 28 12:49:40 790CCV-FW php-cgi[90234]: notify_monitor.php: Message sent to admin@xxxxxxxx.com OK Aug 28 12:50:42 790CCV-FW php-cgi[90234]: notify_monitor.php: Message sent to admin@xxxxxxxx.com OK Aug 28 12:51:44 790CCV-FW php-cgi[90234]: notify_monitor.php: Message sent to admin@xxxxxxxx.com OK Aug 28 12:52:17 790CCV-FW php-cgi[90234]: notify_monitor.php: Message sent to admin@xxxxxxxx.com OK Aug 28 12:53:19 790CCV-FW php-cgi[90234]: notify_monitor.php: Message sent to admin@xxxxxxxx.com OK Aug 28 12:54:21 790CCV-FW php-cgi[90234]: notify_monitor.php: Message sent to admin@xxxxxxxx.com OK Aug 28 12:55:23 790CCV-FW php-cgi[90234]: notify_monitor.php: Message sent to admin@xxxxxxxx.com OK Aug 28 12:56:25 790CCV-FW php-cgi[90234]: notify_monitor.php: Message sent to admin@xxxxxxxx.com OK Aug 28 12:57:28 790CCV-FW php-cgi[90234]: notify_monitor.php: Message sent to admin@xxxxxxxx.com OK Aug 28 12:58:30 790CCV-FW php-cgi[90234]: notify_monitor.php: Message sent to admin@xxxxxxxx.com OK Aug 28 12:59:32 790CCV-FW php-cgi[90234]: notify_monitor.php: Message sent to admin@xxxxxxxx.com OK
-
@jrey Its running every minute for some reason. Every 12hrs i have set up works fine for me.
-
because you have an * in the first position Every minute of the 12th hour of every day is that really what you want ?
you likely want it to run 1 time so pick a minute in the 12th hour
10 12 * * *
on the 10th minute of the 12th hour of every day...
if you want to run it twice a day.
10 0,12 * * *
the 10th minute of hour 0 and 12
so run at
00:10
12:10 -
What are you trying to do there? You appear to have it set to run every minute in hour 12. And it looks to be doing that.
You probably want minute 1 of hour 12 like:
1 12 * * * root /usr/local/bin/php -q /root/pkg_check.php
-
@stephenw10 Ok i see the error.
Curious why the other firewall isn't firing off every minute as well. There are packages that need upgrading.
But good catch everyone. Thanks for pointing out the error to me.
-
@jrey said in cron job wont stop:
o run 1 time so pick a minute in the
Thats exactly the problem. Thanks @jrey
-
@michmoor said in cron job wont stop:
Curious why the other firewall isn't firing off every minute as well
It likely is - as the cron settings are the same (so it runs fine, might be an illusion)
Not sure what the script is actually doing, since I don't use it - you want to share the link to it - I'll peek
but it could simply be a case that the 6100 has enough horse power to complete the task in under a minute and the 1100 does not. Lot's of factors and possibilies to consider -- when the jobs on the 1100 start colliding more bad things likely happen thus the "spam"
does the script actually log that it has run somewhere ?
-
The conversation is here. https://forum.netgate.com/topic/137707/auto-update-check-checks-for-updates-to-base-system-packages-and-sends-email-alerts/70
The script is here
https://gist.github.com/luckman212/5e69ecf04e000ace47eb8f760b71e160
-
Yeah I actually just found it
Auto update check, checks for updates to base system + packages and sends email alerts:
look at the sample cron the author has there in the first post
1 18 * * * blah
Minute 1 of the 18th hour ..
Pick a minute and hour of you choice, run it once not 60 times in the hour, you'll be fine ... servers everywhere will be fine ... spam will stop all will be well.
On that post @stephenw10 said in Auto update check, checks for updates to base system + packages and sends email alerts:
Needs more blinkenlight action!
I don't think he meant once a minute for an hour....
-
@jrey lol
-
Blinkenlights. Always.
-
@jrey said in cron job wont stop:
does the script actually log that it has run somewhere ?
If there was a cron log on pfsense, you would see that your 6100 also ran this script every minute.
But on 6100 everything is up to date, so according to the script :No log lines
No message line on the command interface - which is non interactive, so discarded.
No message (mail in my case)so the system log doesn't show anything if up to date.
-
Good point - I never actually looked at the script referenced only the post that it was provided on. but yes that is why it doesn't show as running on his 6100. It is.
Fixing the cron timing so that it does not "Blinkenlights" so many times - should make everything happy on both systems. Only need 1 Blinkenlight in the hour.