![]() |
|
Cron job - Printable Version +- Sentora Support Forums (https://senforums.mach-hosting.com) +-- Forum: General Forums - (Non-Sentora Support) (https://senforums.mach-hosting.com/forumdisplay.php?fid=1) +--- Forum: Sentora Development (https://senforums.mach-hosting.com/forumdisplay.php?fid=54) +--- Thread: Cron job (/showthread.php?tid=348) |
Cron job - Me.B - 09-23-2014 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.logAlso 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/mycronYou 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/blob/master/sentora_centos7_installer.sh @[5050] @[TGates] @[Nigel] @[motters] @[kandrews] RE: Cron job - kandrews - 09-23-2014 Looks good to me, tested it and its working. I've made a fair few changes at https://github.com/zVPS/Sentora-tools/blob/master/sentora_centos7_installer.sh Pull them in before you make too many more changes
|