This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Cron job
#1
Cron job
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
No support using PM (Auto adding to IGNORE list!), use the forum. 
How to ask
Freelance AWS Certified Architect & SysOps// DevOps

10$ free to start your VPS
Reply
Thanks given by:
#2
RE: Cron job
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
Reply
Thanks given by:


Forum Jump:


Users browsing this thread: 1 Guest(s)