Sentora Support Forums

Full Version: Cron job
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi guys,

I noticed that cron job most of the time work with only direct php call no need for full path.

So the question why we redirect output to /dev/null why we don't log it so we get last daemon run time and last output in case!

Code:
php -q /etc/zpanel/panel/bin/daemon.php > /panel_path/daemon_last_run.log


Also no need for the mess and permission to creat the cron all we have to is here:

Code:
# CRON specific installation tasks... sudo crontab -l -u $HTTP_USER> /tmp/mycron; echo "*/5 * * * * nice -2 php -q $PANEL_DAEMON_PATH >> $PANEL_PATH/daemon_last_run.log 2>&1" >> /tmp/mycron; sudo crontab -u $HTTP_USER /tmp/mycron; sudo rm -f /tmp/mycron


You will notice the variables here.

I'm trying to improve the installer so we can have ONLY ONE installer and variables like this would help adapting to the OS, as most of them are changed uppon OS detection process.

I got :
Code:
SEN_VERSION="master" PANEL_PATH="/etc/zpanel" PANEL_DATA="/var/zpanel" DB_SERVER="mariadb" HTTP_SERVER="httpd" FIREWALL_SERVICE="iptables" HTTP_USER="apache" PHP_BIN_PATH="php" PANEL_DAEMON_PATH="$PANEL_PATH/panel/bin/daemon.php" PACKAGE_INSTALLER="yum"

As you can see here:
https://github.com/MBlagui/Sentora-tools...staller.sh

@[5050] @[TGates] @[Nigel] @[motters] @[kandrews]
Looks good to me, tested it and its working.

I've made a fair few changes at https://github.com/zVPS/Sentora-tools/bl...staller.sh

Pull them in before you make too many more changes Smile