This should fire the restart command every morning at 5, but it is not happening. Is there anything that I am missing here? Is there a better way to schedule a reoccurring fwconsonle command?
You should be able to find the results of the cron job attempt in the (root) userâs e-mail or in /var/log/cron or /var/log/syslog (depending on where your syslog daemon is set to send cron messages).
Iâm not what those last two lines are supposed to do, but they are definitely not right. In fact, Iâd say youâve just destroyed the security of your system by giving everyone on the planet read, write, and execute access to your entire system.
In general, you should NOT be using chmod +777 ever. You donât want the execute but turned on for everything in your system. Of course, chmod +x does pretty much exactly the same thing, so Iâm certain that this is not going to do whatever it was you intended.
/usr/bin/env: pidof: No such file or directory
Asterisk not currently running
Running FreePBX shutdownâŚ
sh: pidof: command not found
sh: pidof: command not found
Restapps daemon was not running
Stopping UCP Server
UCP Server Failed: sh: runuser: command not found
sh: pidof: command not found
XMPP Server was not running
Stopping Zulu Server
Zulu Server Failed: sh: runuser: command not found
Wanrouter: No valid Sangoma Hardware found, if you have no Sangoma cards this is OK
Stopping DAHDi for Digium Cards
DAHDi Stopped
Running VQPlus Hooks
Stopping Queue Callback Daemon
sh: pidof: command not found
I have a similar problem to the OP.
My problem is that when the internet connection is lost temporarily overnight, the PJSIP trunk does not re-register until I do a core reload through the CLI. I want to automate this with a cron job to do core reload at 6am each day. To test this I set it up to reload every minute.
crontab -l gives this:
[root@freepbx ~]# crontab -l
core reload >/dev/null 2>&1
In the cron file I see this:
Feb 21 05:22:01 freepbx crond[950]: (asterisk) RELOAD (/var/spool/cron/asterisk)
Feb 21 05:22:01 freepbx CROND[26633]: (asterisk) CMD ([ -x /var/lib/asterisk/bin/schedtc.php ] && /var/lib/asteri$
Feb 21 05:22:01 freepbx CROND[26634]: (root) CMD (core reload >/dev/null 2>&1)
Feb 21 05:22:01 freepbx CROND[26637]: (asterisk) CMD ([ -x /var/www/html/admin/modules/dashboard/scheduler.php ] $
Feb 21 05:22:01 freepbx CROND[26638]: (asterisk) CMD (/var/lib/asterisk/bin/pagepro-scheduler.php 2>&1 >/dev/null)
Feb 21 05:22:01 freepbx crontab[26661]: (asterisk) LIST (asterisk)
Feb 21 05:22:01 freepbx crontab[26663]: (asterisk) LIST (asterisk)
Feb 21 05:22:01 freepbx crontab[26664]: (asterisk) REPLACE (asterisk)
Feb 21 05:22:01 freepbx crontab[26666]: (asterisk) LIST (asterisk)
Feb 21 05:22:01 freepbx crontab[26668]: (asterisk) LIST (asterisk)
and so on
BUT in the Asterisk log in FreePBX I am not seeing it doing a reload like I see when I do core reload throught the CLI on the GUI.
Is it doing a reload or not?? (The output was unchanged with #!/bin/bash or with #!/bin/sh in the cron command file)
Thanks
Is it a valid entry in asterisk crontab, to say:
0 3 * * * /usr/sbin/fwconsole firewall stop > /dev/null 2>&1
5 3 * * * /usr/sbin/fwconsole firewall start > /dev/null 2>&1
What happens if firewall is not running at 3 o clock? Any error message expected?
Do I need a fwconsole before firewall? or is ist âfwconsole firewall stopâ including quotation marks?
editing asterisk crontab with
EDITOR=nano crontab -u asterisk -e
Problem: my firewall is disabled automatically every morning. Maybe logrotation breaks it.