Cron Job Not Working, Restart Services
Jan 1, 2008
I'm having a bit of trouble with one cron job that doesn't seem to work.
I have others scripts that run hourly fine. However this one does not.
The script:
restart_monitoring.sh
Code:
#!/bin/bash
service iptables stop
service iptables start
/root/bandwidth_rules.sh
/root/portforward_config.sh
exit
The two scripts at the end just load a lot of iptables rules back in.
The cron job should run hourly (59th minute)
The cron job entry
Code:
59 * * * * /root/restart_monitoring.sh
I have restart crond to enable the new job, still doesn't run.
The job is to restart iptables, thus flushing all rules that I have running, then reloading them. I have figured out the problem to be with the "service iptables stop/start" command, it doesn't seem to like doing this...?
View 2 Replies
ADVERTISEMENT
Feb 20, 2008
Is there any way to start plesk services automatically?
As my plesk control panel needs to be restarted every day..
View 5 Replies
View Related
Jun 18, 2007
In the past i've read up on software capable of restarting services that go down. I was wondering what the best free option is right now. I've got three dedicated centos boxes that I need to monitor. I don't need to monitor them all from one place, but would like something that can identify processes such as httpd, mysql, and mydns, then restart them if necessary.
View 2 Replies
View Related
Nov 23, 2008
How to set up cron job automatic restart mysqld at specified time. My case, mysqld will auto restart every 23 hours running.
How to set up this cron job?
View 12 Replies
View Related
May 22, 2007
ive got a fairly beefy server but at the moment its hosting alot of resource intensive sites (unfortunatly i dont currently have a choice on where to run them all) and apache is crashing to the point its taking upto 2 mins to load pages within about 24hours but once restarted is fine again. so im wondering if anyone can suggest a way to automaticly restart apache via a cron job every 24hours or so?
View 6 Replies
View Related
May 5, 2008
My host is experiencing "issues" with my WordPress. It keeps going above their upper limit of open MySQL connections. So, while I am diagnosing it, I need to restart the server every few hours to avoid it going down.
How do I write a cron to restart Apache every 3 hours?
View 5 Replies
View Related
May 30, 2005
This one's pretty simple really, but given the fact that I'm constantly running into crond stops with CPanel servers (no clue why, or where, but it's happening), I'll post this here. If it helps someone, then great, if not, hey, no worries.
Firstly, login as root to your server through ssh, however you usually do .
Next, the script (we'll call it /bin/croncheck.sh). Use whatever editor you choose to create the file.
#!/bin/bash .......
View 14 Replies
View Related
Jul 21, 2014
Out of nowhere apache stops working, and I have to restart the httpd service that restablesca
The message it throws is "Service Unavailable"
The server is a CentOS Linux Centos 6.5
It has 24 cores and 24 GB RAM
These are the values that I have in httpd.conf
Timeout 60
KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 15
[Code]....
View 3 Replies
View Related
Sep 13, 2014
I am having to restart https after a reboot in order to get the virtual hosts working.
If I DON'T restart https, all I get is the system default page and NOT the individual vhost index pages.
View 4 Replies
View Related
Jun 27, 2005
I'm needing some info i have been pulling my hair out for hours trying to get some cronjobs lined up i started out with knowing nothing about it and i'm a little better off now i got the cron running but the commands aren't executing so maybe someone can help me figure out why i would greatly appreciate it
Here's The deal I telnetted in set the following crontab ...
View 4 Replies
View Related
Oct 6, 2007
I have a dedicated CentOS 4.5 Server. However, as you can probably guess I am new to linux and managing a server...
Anyway, beginning of this month my crons quit working, I still receive emails as if they are ran but I can't get the scripts to actually execute.
I have not touched the crontabs or anything prior to them not working, they simply quit working... I did not notice immediatly they did not work, I am guessing that it was around the time of which I rebuilt apache to a new version of PHP. Today I tried changing them to "php path/to/script.php" and I also tried "path/to/php /path/to/script.php", neither worked.
Any ideas or suggestions as to how I can fix this?
View 9 Replies
View Related
Jun 9, 2007
I have a slight problem with a cron job I have setup.
I wanted to save a copy of iptables every hour to a folder, so I created a script... here it is:
Code:
varDate=`date +%y%m%d`
varTime=`date +%H%M`
filename="IPtablesBackup-$varDate-$varTime"
iptables-save -c > /etc/IPtablesBackup/$filename
and called is Backup-Script.sh
Now if I just execute the script will in root ./Backup-Script.sh I get a new file with the correct filename and iptables info is saved ! Great ! So then I thought, how can I setup this automatically every hour.
Which leads me on to my problem. I inputted "crontab -e" added this line
Code:
59 * * * * /etc/IPtablesBackup/Backup-Script.sh
The problem is the script is run, I know because it creates a new file with the correct time and date, however the file is empty?
I have set Backup-Script.sh to 777 and owner and group are both root?
View 4 Replies
View Related
Jun 19, 2007
I recently purchased a new dedicated server, since I have had this server (8 days) I have being receiving the following email:
Quote:
/etc/cron.daily/logrotate:
error: error accessing /var/log/httpd: No such file or directory
error: httpd:1 glob failed for /var/log/httpd/*log
View 9 Replies
View Related
Jul 4, 2007
I did not realize the significance of the Apache sub-forum. I thought perhaps this would be a more general Server management query, but I realize now I should have posted in Apache forum.
I have been banging my head against the wall for the last couple of days trying to get cron jobs working. It's actually making me quite depressed, a lot of people are waiting on me to get this working, and for the life of me I see no light. I'm not a stupid person, i'm a PHP developer, and have some linux skills. This is the single most annoying issue I have had to deal with simply because I cannot find any troubleshooting methods to my issue.
I have tried every different combination of command under the sun and I cannot get any sign that the cron is running the commands.
I own a "virtual" dedicated server with a hosting company, I have full root access. Linux / Apache
The script file is a PHP file which simply mail() an email saying that cron is working, I am yet to receive this mail that was executed by cron.
I have ensured there are no errors in this simple PHP file, I have executed the script from the shell and all is well there..
So, firstly I tried to setup the cron table from CPanel, on the account where the script resides.
I used the following command combinations:
Code:
0-59 * * * * /usr/local/bin/php /home/username/public_html/cron.php
0-59 * * * * php -q /home/username/public_html/cron.php
0-59 * * * * php /home/username/public_html/cron.php
0-59 * * * * cd "/home/username/public_html/"; php cron.php
0-59 * * * * wget [url]
with time combinations of:
* * * * *
to get the command to be executed evey minute, for testing purposes.
All these commands work fine when executed through the shell.
I set the mail address for cron output to be my mail address also.
I do not get any mail from cpanel with an overview of the cron executions.
I then gave up trying to get cron to work on that account, and decided to go root.
I logged into the shell via root, checked the cron table for root. I edited the root cron table (that contains commands for various cpanel scripts etc) to include a command to execute the php script, even with the script residing on the root directory.
I also added MAILTO="myemail@email.com" to the first line of the cron table.
I do not get any emails of the cron actions.
How can I check if the cron scheduler is working when I get no sign that the cron commands are being executed, and when I do not receive any cron emails? What methods are there for me to troubleshoot this issue?
Could it be possible that cron shedular is not active on my server?
I have lurked the net with great detail to find any method to troubleshoot my issue, and all the related pages I find are to do with troubleshooting the commands. I know my commands are fine, there is some other issue here.
View 2 Replies
View Related
Nov 9, 2008
How do I make sure that there are cron jobs running on my cPanel server? I have root access, etc...just not sure why my crons aren't running. Nothing weird going on.
View 7 Replies
View Related
Jun 14, 2007
I was hoping someone could shed some light on a cron related issue I'm having.
I've been using linux for a while...but never really used crons.
My cron is supposed to dump a postgres db in tar.gz format every minute (for testing purposes) but it doesn't.
I opened my cron in vim via:
Code:
postgres@myhost:~$ crontab -e
And here's the cron:
Code:
* * * * * /usr/bin/pg_dump -D warranty_1_6_test | gzip -c > /var/www/test/postgres/backup$(date +"%Y%m%d_%H%M").tar.gz
Also:
Code:
postgres@myhost:~$ ls -lah /var/www/test/postgres/
total 8.0K
drwxrwxrwx 2 postgres postgres 4.0K 2007-06-14 12:01 .
drwxr-xr-x 3 user user 4.0K 2007-06-14 11:47 ..
Running the backup command via CLI works fine.
View 5 Replies
View Related
Feb 17, 2015
If you rename a domain, fail2ban will stop working, since it still tries to open the old path the the web access log.
One workaround is to restart the server after renaming the domain, then fail2ban paths are updated.
I'm using plesk 12.0.18.
View 8 Replies
View Related
Jan 1, 2007
I have edited /var/spool/cron/root file
and I've added this line:
*/1 * * * * rm -f /tmp/*.pl
and I have created file lol.pl
and after 10 minute file is still there, why?
View 4 Replies
View Related
Aug 19, 2014
i have setup fresh Centos 6.5 with Plesk Pannel 12.0.18. When i execute the attached command from the console, i get it work, some posts are auto created within wordpress. When i enter the attached command within Plesk (Tools / Settings - Taskmanager - root New Task, the command is not executed...
/usr/bin/wget --post-data='id=4&minposts=1&maxposts=3' -O /dev/null http://www.mydomain.com/wp/wp-content/plugins/WPRobot3/cron.php?code=UNIQUEID
I tried also without /usr/bin at the beginning, but its not working with cron automatic
View 3 Replies
View Related
Apr 24, 2008
I have a domain with a few forwarding email accounts that forward to mac.com email accounts... for some reason every once in a while these accounts stop working...
This is the error I get when I email to that account:
This message was created automatically by mail delivery software.
A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed: ...
View 9 Replies
View Related
Jul 3, 2007
I have directory shared by NFS on server1 this directory mounted at startup on server2.
problem happened when twice servers restarted and server2 started before server1. directory not mounted I must mount it manually.
View 4 Replies
View Related
Jul 19, 2007
One of my server's http daemon is restarting more often and it doesn't have any control panel. How can I checked the load or memory usage history?
View 3 Replies
View Related
Aug 31, 2006
I get the following message via SSH when i try named restart
named: symbol lookup error: named: undefined symbol: dns_resolver_setudpsize
All my sites are currently down but the server is up and bind wont restart either in WHM or SSH
i am using WHM 10.6.0 cPanel 10.8.0-R8
CentOS 4.3 i686 - WHM X v3.1.0
Linux ***.server.com 2.6.9-11.EL #1 Wed Jun 8 16:59:52 CDT 2005 i686 i686 i386 GNU/Linux
I spoke to live support at nexpoint but they told me to email their dedicated server support but I havent had a reply in the last few hours.
View 5 Replies
View Related
Apr 23, 2008
I have 8 apache servers that is sharing one httpd.conf file... When changes made in the httpd.conf, you have you restart httpd... How can I restart all 8 servers at the same time instead of logging into each server and do it manually?
View 2 Replies
View Related
Oct 13, 2009
i am having an issue with my vps recently my ftp is down and i cant restart my ftp not sure how i can get this fix.
View 8 Replies
View Related
May 28, 2009
how to restart lighthttpd?
I was asked to restart lighthttpd at my friend host, he has 6 sites running, and of the site is down, host has asked him to restart the server, as he is away, he wanted me to restart, but I have no clue how to restart lighthttpd,
It will be really helpful if u can guide me for : if possible for the domain alone, else for the entire server
current options available :
lxadmin - hypervm
ssh connection
let me know the steps and code if any.
View 4 Replies
View Related
Jul 17, 2009
We are unable to restart apache on our server, as a result no sites are accessible in the browser. Our host states we need to clear out the following files:
[root@server1 logs]# ls -lAh|grep -v ' 0 '
total 1.9G
-rw-r--r-- 1 root root 92M Jul 17 07:55 access_log
-rw-r----- 1 root root 463K Dec 9 2007 audit_log
-rw-r--r-- 1 root root 1.2G Jul 17 07:57 error_log
-rw-r--r-- 1 root root 6 Jul 17 07:42 httpd.pid
-rw-r--r-- 1 root root 92K Feb 18 2008 ssl_engine_log
-rw-r--r-- 1 root root 535M Jul 17 07:46 suexec_log
-rw-r--r-- 1 root root 10 Jul 17 03:21 suexec_log.offset
-rw------- 1 root nobody 5.6M Dec 10 2007 suphp_log
Is it ok to simply delete these files? If so, will they recreate
themselves?
View 14 Replies
View Related