alemmsm Verified User Joined Nov 9, 2017 Messages 43 Jan 6, 2018 #1 Cron Job Command for restart httpd Service ? Similar to the following command : :2222/CMD_SERVICE?action=restart&service=httpd
Cron Job Command for restart httpd Service ? Similar to the following command : :2222/CMD_SERVICE?action=restart&service=httpd
zEitEr Super Moderator Joined Apr 11, 2005 Messages 15,232 Location GMT +7.00 Jan 7, 2018 #2 Hello, Add into cron the command with your desirable frequency: Code: echo "action=httpd&value=restart" >> /usr/local/directadmin/data/task.queue and Apache will be restarted within 1 minute by directadmin.
Hello, Add into cron the command with your desirable frequency: Code: echo "action=httpd&value=restart" >> /usr/local/directadmin/data/task.queue and Apache will be restarted within 1 minute by directadmin.
alemmsm Verified User Joined Nov 9, 2017 Messages 43 Jan 7, 2018 #3 Look at the picture I created a file /home/admin/df201rreeee.php And put in the file echo "action=httpd&value=restart" >> /usr/local/directadmin/data/task.queue But it will not be restart httpd Service again every minute Last edited: Jan 7, 2018
Look at the picture I created a file /home/admin/df201rreeee.php And put in the file echo "action=httpd&value=restart" >> /usr/local/directadmin/data/task.queue But it will not be restart httpd Service again every minute
wattie Verified User Joined May 31, 2008 Messages 1,235 Location Bulgaria Jan 7, 2018 #4 That's not a command - that's a php file. Check out the previous answer from Alex. Instead of "/home/admin/df201rreeee.php" write "echo "action=httpd&value=restart" >> /usr/local/directadmin/data/task.queue" Why you want to restart it every 1 minute?
That's not a command - that's a php file. Check out the previous answer from Alex. Instead of "/home/admin/df201rreeee.php" write "echo "action=httpd&value=restart" >> /usr/local/directadmin/data/task.queue" Why you want to restart it every 1 minute?
zEitEr Super Moderator Joined Apr 11, 2005 Messages 15,232 Location GMT +7.00 Jan 7, 2018 #5 alemmsm said: I created a file /home/admin/df201rreeee.php And put in the file Click to expand... That's not PHP syntax, it's a bash/shell. alemmsm said: But it will not be restart httpd Service again every minute Click to expand... Only user root and diradmin can write into the file due to the directory permissions. Code: # ls -lad /usr/local/directadmin/data/ drwx--x--x 8 diradmin diradmin 32K Jan 8 06:02 /usr/local/directadmin/data/ If you don't have root permissions on the server you need to use API: https://www.directadmin.com/features.php?id=759
alemmsm said: I created a file /home/admin/df201rreeee.php And put in the file Click to expand... That's not PHP syntax, it's a bash/shell. alemmsm said: But it will not be restart httpd Service again every minute Click to expand... Only user root and diradmin can write into the file due to the directory permissions. Code: # ls -lad /usr/local/directadmin/data/ drwx--x--x 8 diradmin diradmin 32K Jan 8 06:02 /usr/local/directadmin/data/ If you don't have root permissions on the server you need to use API: https://www.directadmin.com/features.php?id=759
alemmsm Verified User Joined Nov 9, 2017 Messages 43 Jan 16, 2018 #6 If I want to run when is load average on 5 minutes what do I do #!/bin/sh check=`cat /proc/loadavg | sed 's/\./ /' | awk '{print $1}'` if [ $check -gt 10 ] //10 is load average on 5 minutes then httpd restart fi It does not work */5 * * * * root /usr/local/auto/restart.sh >/dev/null 2>&1 Last edited: Jan 16, 2018
If I want to run when is load average on 5 minutes what do I do #!/bin/sh check=`cat /proc/loadavg | sed 's/\./ /' | awk '{print $1}'` if [ $check -gt 10 ] //10 is load average on 5 minutes then httpd restart fi It does not work */5 * * * * root /usr/local/auto/restart.sh >/dev/null 2>&1
zEitEr Super Moderator Joined Apr 11, 2005 Messages 15,232 Location GMT +7.00 Jan 16, 2018 #7 And what is Code: httpd restart ? Is it a function call from your script? Or typo?
alemmsm Verified User Joined Nov 9, 2017 Messages 43 Jan 16, 2018 #8 service httpd restart WHEN Warning: The system load average is 155.83 Auto reboot script with up loaded server I want to be upgraded when it is loaded Apache
service httpd restart WHEN Warning: The system load average is 155.83 Auto reboot script with up loaded server I want to be upgraded when it is loaded Apache
zEitEr Super Moderator Joined Apr 11, 2005 Messages 15,232 Location GMT +7.00 Jan 18, 2018 #9 Use monit for this. Or test and debug the script.
W websterPL Verified User Joined Oct 7, 2021 Messages 87 Aug 16, 2023 #10 I have just below code in Crone Command: Code: echo "action=httpd&value=restart" >> /usr/local/directadmin/data/task.queue And email notice is: Code: /bin/sh: 1: cannot create /usr/local/directadmin/data/task.queue: Permission denied
I have just below code in Crone Command: Code: echo "action=httpd&value=restart" >> /usr/local/directadmin/data/task.queue And email notice is: Code: /bin/sh: 1: cannot create /usr/local/directadmin/data/task.queue: Permission denied
cjd Verified User Joined Feb 1, 2021 Messages 350 Location Canada Aug 16, 2023 #11 Old thread, all info you need is there, needs to be done as root user.