Cron Not Working On CPanel Server
Nov 9, 2008How 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 RepliesHow 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 RepliesI'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 ...
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?
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?
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
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.
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...?
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.
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?
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
I was changing IP Addresses on one of my domains on my VPS to a spare fresh IP.
Since doing this, my DNS hasn't fully propgated, so I'm then facing this message.
Apache is working on your cPanelŽ and WHM Server
Now my question is, how do I change this default green Cpanel page? Could I swap it with my own page?
Just got a new server online this week from VolumeDrive, and everything has been going just fine with my initial setup. I transferred over 7 domains from another cPanel/WHM machine and the transfer feature worked flawlessly.
Since I use Gmail for most of my communication, I haven't even had any email accounts setup on any of my domains in quite sometime. So knowing that I need a few setup for various correspondence, I went ahead and set one up tonight. I've setup and used mailboxes on cPanel machines before, and it's not exactly rocket science... pretty easy stuff.
But what's weird here is that when I attempt to click on the "Webmail" icon from directly within cPanel, the Horde login fails over and over again. Then, if I setup the account in Thunderbird or Outlook using the CORRECT account information (username@domain.com as the login -- and the appropriate password/server settings), the client login fails also.
To add to this weird behavior, I sent myself an email at the newly setup address with a 2mb attachment. Obviously I can't login to the account to see if the mail arrived, but at least it didn't bounce.
However, when I'm in cPanel under this domain and go to "Email Accounts", I'm showing "0 Bytes" for usage under the account where i know there should be at least 2mb worth of usage.
Cpanel version 11.1.0
Fedora Core 6
This is a totally fresh install. I noticed bind was not running so I went to do a restart in WHM and I get the following error..
named has failed, please contact the sysadmin (result was "named is not running"). Jun 5 14:19:14 dts131 named: /etc/named.conf:65: open: /var/named/named.rfc1912.zones: file not found
I just went through a week of nightmares, because my host lost hard drives and stuff.. lost my data, etc.. what ever..
I want to work out how I can cron cPanel backups. I did a search online for a cPanel backup manager, but I didn't have much luck.
Or, maybe there's some other way to get regular backups?
I don't really need to backup my whole sites. I keep my files locally, but of course I don't have the databases locally -- or the email records.
All I "really" need is the database SQL files, so that I can rebuild my forums if need be, and also the email setup files -- because I have over 50 domains and I have emails set up on all of them.
I want to have them emailed to myself.
There's an option in cPanel too, which allows me to "generate/download a full backup".. well, how do I "restore" the backup? ie: I know how to backup and restore the home directory, databases and email stuff (there's 3 options in cPanel), but there doesn't seem to be anywhere to restore the full backup.
Anyway, can anyone give me advice on how to keep backups of my cPanel accounts? I don't trust hosts anymore. They say they back stuff up, but they never to.
Im setting up new windows server, packed with only FTP server (FileZilla) to remote backups.
How can i get my cpanel account make backups and upload them to my FTP server as an cron job? Offcourse i have option to backup via cpanel, but this is needed to do manually every time (setting remote ftp ip, account, passwd etc,).
Is there a option in cpanel / whm to do full-backup all my accounts in my reseller account? Or do i need to do it per account? Some of my servers is only reseller accounts without root access, only reseller account.
I want to know how to get this cron job to work. Get a php script to run at certain times, etc.
View 4 Replies View Relatedif you have a website with 2 or more servers
i have two server, both are using whm/cpanel
i had been pointing a subdomain.domain.com to the second server IP 111.222.333.444 in first server WHM "Edit DNS Zone", its already 48 hours now
now i can login the ftp subdomain.domain.com, its success to login to the ftp
but its still showing this message when open the subdomain site from browser
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.
ATTENTION!
If you are seeing this page instead of the site you expected, please contact the administrator of the site involved. (Try sending an email to <webmaster@domain>.) Although this site is running cPanel, WebHost Manager, and Apache software it almost certainly has no other connection to cPanel Inc. or the Apache Group. Please do not send mail about this site or its contents to cPanel Inc. or the Apache Group.
About cPanel:
cPanel is a leading provider of software for the webhosting industry. If you would like to learn more about cPanel please visit our website at www.cpanel.net. Please be advised that cPanel Inc. is not a web hosting company, and as such has no control over content found elsewhere on this site.
About Apache HTTP Server:
The Apache HTTP Server is an open source web server which powers many of the worlds web sites. The Apache HTTP server is part of the Apache Group's many influential projects. Their efforts have helped shape much the world wide web, and they continue to be a dominating force in the web hosting industry.
if you have a website with 2 or more servers
i have two server, both are using whm/cpanel
i had been pointing a subdomain.domain.com to the second server IP 111.222.333.444 in first server WHM "Edit DNS Zone", its already 48 hours now
now i can login the ftp subdomain.domain.com, its success to login to the ftp
but its still showing this message when open the subdomain site from browser
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.
ATTENTION!
If you are seeing this page instead of the site you expected, please contact the administrator of the site involved. (Try sending an email to <webmaster@domain>.) Although this site is running cPanel, WebHost Manager, and Apache software it almost certainly has no other connection to cPanel Inc. or the Apache Group. Please do not send mail about this site or its contents to cPanel Inc. or the Apache Group.
About cPanel:
cPanel is a leading provider of software for the webhosting industry. If you would like to learn more about cPanel please visit our website at www.cpanel.net. Please be advised that cPanel Inc. is not a web hosting company, and as such has no control over content found elsewhere on this site.
About Apache HTTP Server:
The Apache HTTP Server is an open source web server which powers many of the worlds web sites. The Apache HTTP server is part of the Apache Group's many influential projects. Their efforts have helped shape much the world wide web, and they continue to be a dominating force in the web hosting industry.
I have problem witch crontab in cPanel. Cron not adding entries in cPanel --> Cron jobs. No errors.
View 3 Replies View RelatedI have been doing some research and I would love some help with this. I want to set up a cron to automatically backup my site's files & databases once a month. And I am not sure what how I do it?
- Do I need a script on my server and then the cron job runs it?
- Is there a better way to do this then cron?