Howto: Automatically Verify Cron / Crond Is Running And Restart If Not

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


ADVERTISEMENT

HOWTO Cron Job To Copy Files From Folder To Root

Feb 5, 2008

how to setup a cron job to copy files & directories from one folder to the root folder. I have CPanel X.

My root directory is public_html/
I have another directory public_html/uploads containing both files and directories.

I need a cron job that will copy all the files & directories from public_html/uploads to the root public_html/

If it helps, here is some system info

General server information:
Operating system Linux
Service Status Click to View
Kernel version 2.6.22_hg_grsec_pax
Apache version 1.3.39 (Unix)
PERL version 5.8.8
Path to PERL /usr/bin/perl
Path to sendmail /usr/sbin/sendmail
PHP version 4.4.4
MySQL version 4.1.22-standard
cPanel Build 11.17.0-STABLE 19434
Theme cPanel X v2.6.0

View 1 Replies View Related

How To Restart Apache Automatically

Jan 16, 2013

How to restart apache automatic every 12 hours ?

View 6 Replies View Related

VPS Httpd Failed And Restart Automatically

Feb 17, 2008

almost daily my VPS httpd failed and restart automatically, after that all services show UP but my sites not working.. Only start working when I restart DNS Server (BIND).

I am using CPanel

View 7 Replies View Related

How To Restart Plesk Services Automatically

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

Cpsrvd Failed - A Restart Was Attempted Automatically

Jan 26, 2008

i received 4 emails like this today, and now my sites are offline. what does "cpsrvd failed - A restart was attempted automagicly." mean and why are my sites now offline?

View 4 Replies View Related

Automatically Restart Mysql After High Server Load

Jan 29, 2009

Anyone know a good script that I can run with cron or something? Mysql seems to be the #1 problem with a lot of my web sites, a restart usually fixes it right away for me, but I can't keep restarting my servers everyday manually.

View 1 Replies View Related

Cpanel :: Cpsrvd Failed @ .. A Restart Was Attempted Automatically

Jul 18, 2008

cpanel was automatically send me this email.

cpsrvd failed @ Fri Jul 18 11:29:52 2008. A restart was attempted automatically.

how to resolve this one?

View 7 Replies View Related

Create A Cron Job To Clear Your /tmp Folder Automatically?

Dec 15, 2008

how I can create a cron job that runs every 10minutes or so to clear my /tmp folder on one of my servers?

Reason I ask is, it keeps getting filled up and doesn't delete the fiels in it and stops certain scripts from running.

Also, again, I need step by step instructions, such as:

1) what, where the file is I need to place the cron job in

2) what line of code would I put in that file (what does the cron job line look like for every 10min every day)

3) do I need to restart anything, and if so, what command do I run in shell?

View 9 Replies View Related

How To Set Up Cron Job To Restart Mysql

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

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 View Related

Auto Restart Apache On Cron

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

How To Add Cron To Restart Apache Server Every Three Hours

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

Cron Jobs Not Running

Jan 5, 2008

I have a machine, that for some reason stopped running it's cron jobs for some reason, and I can figure out how to get them working again.

My /etc/crontab file is as follows.

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
Here are the contents of a sample user cron file.

MAILTO="USER"
10 4 * * * php -q -f /home/USER/public_html/tools/updtransfers.php /home/USER/public_html >/dev/null 2>&1
10 5 * * * php -q -f /home/USER/public_html/tools/updateexp.php /home/USER/public_html >/dev/null 2>&1
10 5 * * * php -q -f /home/USER/public_html/tools/invoice_cron.php /home/USER/public_html >/dev/null 2>&1
and another

*/5 * * * * /usr/local/bin/php -c /home/USER/php.ini /home/USER/public_html/poller.php > /dev/null 2>&1
I've checked my logs, and I can find no errors anywhere. When I run the commands manually via SSH, they work perfectly, they simply are not being run automatically the way they are supposed to be.

I have checked, and the crond service is running. I have tried restarting it, but it seams to have no affect. I really have no idea what the issue is. The only thing I seam to have found at one point, was the possibility that the files within the /etc/cron.d directory might be CHMOD'ed wrong, but I haven't found anything to confirm this either way.

[root@server cron.d]# ls -all
total 60
drwxr-xr-x 2 root root 4096 Dec 17 03:07 .
drwx--x--x 94 root root 12288 Jan 3 09:28 ..
-rw-r--r-- 1 root root 61 Jun 22 2007 csf_update
-rw-r--r-- 1 root root 81 Apr 11 2007 lsm
-rw-r--r-- 1 root root 79 Jun 22 2007 prm
-rw------- 1 root root 366 Feb 23 2007 sa-update
-rw-r--r-- 1 root root 82 Jun 22 2007 spri
-rw-r--r-- 1 root root 188 Nov 16 23:14 sysstat
[root@server cron.d]#

View 3 Replies View Related

Running Perl Script On Cron

Jan 25, 2007

I tried using this perl script which supposedly restarts apache when server load reaches 5 and above

Code:
#!/usr/bin/perl -w
#use strict;
$|++;
open(LOAD,"/proc/loadavg") || die "couldn't open /proc/loadavg: $!
";
my @load=split(/ /,<LOAD>);
close(LOAD);
if ($load[0] > 5) {
`/sbin/service httpd restart`;
}
and placed it in /usr/local/script/loadavg.pl and chmod to 755

and added this to my crontab

*/1 * * * * root /usr/local/script/loadavg.pl

my server load went up to 20 and waited if it will automatically go down via the script but it seems it's not working. I had to restart apache manually.

View 4 Replies View Related

Plesk 12.x / Linux :: Cron Not Running

Dec 30, 2014

I have just recently moved to Plesk web admin from cpanel. I have been trying to get the cron to run for the past 48 hours but no luck. Bellow is the code i have been trying to execute via cron but It does not run.

"/usr/bin/php /var/www/ vhosts/mydomain. com /httpdocs/billing/index.php cron"

View 8 Replies View Related

Crond Multiple Processes

Aug 16, 2007

I'm sure this isn't normal, but I have to ask. Is this normal :

...and if not, why on earth will it be doing this? ....

View 1 Replies View Related

Pile Up Of Crond Processes At Certain Times

May 10, 2009

To me, this sounds really strange and really unrelated, hopefully it will ring a bell in somebody-who-reads-this' mind...

After enabled suexec in my webserver (litespeed), every day at two regular times, I notice a ton of crond processes on many different users. This slows down my entire server until they go away and it must be resolved.

I have only recently noticed that it is infact crond processes causing this and I hope I have finally found the correct issue. It causes a chain reaction of events and so I have slowly had to crawl up the chain to find the root of the issue... (high iowait, high swapping, high memory, normal processes taking up more cpu%, etc. etc. ........ crond processes)

I have checked every single file in /var/spool/cron and none of the cron jobs run remotely near these times (except some that run every minute/15 minutes for example). Also, I don't understand how so many crond processes could be made at once. I will make a better rough estimate when it next happens.

What could it be causing this to happen?

View 9 Replies View Related

Howto For Suexec, Php As Cgi

Aug 28, 2007

I've been attempting to develope a server running apache 2+, php 5, and I was running into issues installing php as cgi.... All my scripts require The shebang:
#!/usr/bin/php at the top to execute properly. Anyone know a good site/how to that explains how to do this?

has anyone else here run suexec with apache? If so, could you tell me what you compiled it with? Just curious, as I think i'm doing everything right, yet I still fail

View 2 Replies View Related

HOWTO Install FFMPEG

Nov 27, 2006

FFMPEG INSTALLATION FROM SOURCE
FFMPEG INSTALLATION FROM SOURCE
installed by:
Robertas Dereskevicius
Edited by Jon Nikolakakis
OS/ Fedora Core 5

Summary
download and install:
libffac
libffad2
xvid
libogg,libvorbis
mp3lame
ffmpeg

Setting Up Install Folder, Logging and download Packages
1)Log into ssh
2) cd /usr/src && mkdir install && cd install
3) Download faad2 and faac
from http://faac.sourceforge.net/oldsite/download.php get Faad2 and faac (new versions)

wget http://prdownloads.sourceforge.net/f...ar.gz?download
wget http://prdownloads.sourceforge.net/f...ar.gz?download

4) Verify that you have these components are installed
rpm -qa automake
rpm -qa autoconf
rpm -qa libtool
rpm -qa m4
rpm -qa gcc-c++

If any are missing than simply yum install (packagename), if you dont have a package manager than get one, it will save you alot of time
and headaches.

Installing Faac
5)tar -zxvf faac-1.24.tar.gz && cd faac
6) sh bootstrap
7) ./configure
8) make
9) make install
10) cd ..

Installing Faad2
11) tar -zxvf faad2-2.0.tar.gz
12) cd faad2 && less README.linux
13) There is 2 bugs with this package, so need to manually edit these files
14) nano Makefile.am
Edit the file to look like this
SUBDIRS = libfaad common frontend plugins
EXTRA_DIST = faad2.spec

15) cd common/mp4ff && nano mp4ffint.h
16) Comment out this line
//void mp4ff_track_add(mp4ff_t *f);

17)Save file and cd ../..
18)autoreconf -vif
19) ./configure
20) make
21) make install

Installing Libogg and Libvorbis
22)cd .. and then Check to see if libogg and libvorbs
rpm -qa libogg-devel
rpm -qa libvorbis-devel
rpm -qa libncurses-devel

If not installed then simply Package Install (replace yum and install settings with your package manager)
yum install libogg-devel
yum install libvorbis-devel
yum install libncurses-devel

Installing LAME (for audio)
23)go into lame sourceforge - http://sourceforge.net/project/showf...package_id=309
24)wget http://mesh.dl.sourceforge.net/sourc...me-3.97.tar.gz
25)tar -zxvf lame-3.97.tar.gz
26)cd lame*
27) ./configure; make;make install

Installing Xvid
28) cd .. && wget http://downloads.xvid.org/downloads/...e-1.1.2.tar.gz
29)tar -zxvf xvidcore-1.1.2.tar.gz && cd xvid*/build/generic/
30) ./configure; make; make install;
31) cd ../../..

Installing ffmpeg
32) rpm -q subversion If not install, then install subversion
33)svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg && cd ffmpeg
34) ./configure --enable-shared --enable-xvid --enable-vorbis --enable-libogg --enable-mp3lame --enable-gpl --enable-faad --enable-faac --enable-a52
35)make
36)make install

If Installation went ok, run
ldd ./ffmpeg
If Path to Lib Libraries are not ok

37)Check to see if /usr/local/lib exists on this file
cat /etc/ld.so.conf

If not
echo /usr/local/lib >>/etc/ld.so.conf

38) cat/etc/ld.so.conf Now check to see if (/usr/local/lib exist)
39) save file
40) ldconfig
41) run ldd ./ffmpeg

FFmpeg should be complete and installed. On some servers you may need to add Disable Shared and enable flags.

View 14 Replies View Related

HowTo : Subdomain Only In Other Host

Dec 24, 2008

i have 1 dedicated server, and 1 shared hosting the domain.com is hosted in dedicated server i want the subdomain sub.domain.com in other host

i have try this but not working :

I. the dedicated server have whm and cpanel

in whm i go to DNS Functions --> Edit DNS Zone --> i add sub name , choose A, and enter other ip host

II. the shared hosting only have cpanel

i go to cpanel --> addons domain --> add my domain.com
then go to cpanel again --> Subdomains --> i add sub from domain.com

with above step i just got this when accessing the url http://sub.domain.com :

Quote:

Great Success !
Apache is working on your cPanel® and WHM™ Server
If you can see this page, then the people who manage this server have installed cPanel and WebHost Manager (WHM) which use the Apache Web server software and the Apache Interface to OpenSSL (mod_ssl) successfully. They now have to add content to this directory and replace this placeholder page, or else point the server at their real content.

View 5 Replies View Related

Howto Load Tun/tap On Centos XEN VPS

Aug 31, 2007

Anyone have any info on how to do this? It appears my hosts don't know how to do it..

"You have the tun module which can be loaded via a modprobe but the dev entries would appear to be needed to be made. Of course, you could do this if you know how or wait while I research it. We know tun/tap works on openvz but you're the first request we've had on Xen."

View 1 Replies View Related

HowTo - Bouncing Of Dedicated

Jun 13, 2007

I'm on CentOS 4.4, webmin, LAMP, OpenSSH and ProFTPD server.

But what I'm wondering is how to look at my off network backup space.

I can only access my backup space through the DC network/my own server. So I need some kind of way to bounce a GUI ftp connection off the server - which would allow me to look at the files...

I know I can use rsync for backing up and restoring. But the way I understand rsync I need to know exactly what I am to move, as it operates on an exact command.

View 2 Replies View Related

Howto Load Tun/tap On Centos XEN VPS

Aug 31, 2007

"You have the tun module which can be loaded via a modprobe but the dev entries would appear to be needed to be made. Of course, you could do this if you know how or wait while I research it. We know tun/tap works on openvz but you're the first request we've had on Xen."

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved