crontab
Posted by: gamerhk
Posted on: 2006-04-23 23:52:00
is there a way to set that in cpanel?
or i have to ssh?
Posted by: gamerhk
Posted on: 2006-04-23 23:52:00
is there a way to set that in cpanel?
or i have to ssh?
Posted by: doeleman
Posted on: 2006-04-24 02:48:00
By CPanel I guess you mean DreamHost's Control Panel (they are not using CPanel, but their own custom built control panel)?
Anyway, you have to set your cronjobs via ssh at DreamHost.
Posted by: matttail
Posted on: 2006-04-24 11:49:00
This Wiki Article should be of some help. I just revised it a little so things are hopefuly a little clearer.
-Matttail
Posted by: silurius
Posted on: 2006-04-25 12:04:00
The Wiki article is great, but I'm not totally clear on where my crontab file needs to be saved in order to ensure that it actually gets executed. I have to assume that my default folder under /tmp is incorrect.
Posted by: sdayman
Posted on: 2006-04-25 16:56:00
The 'crontab' command command listed in the Wiki will save the cron file in its proper location. There's no need to tell it where.
-Scott
Posted by: silurius
Posted on: 2006-04-25 17:09:00
When I saved mine, it defaulted to /tmp/crontab.NIK3Db/crontab, and the tasks I defined did not appear to run. Does this indicate a syntax problem in my cron file itself, or this is not a good location?
Posted by: sdayman
Posted on: 2006-04-25 18:39:00
I think that's a temp file the editor uses, but the real file does get saved.
Do a 'crontab -l' to see what's in your crontab file.
If crontab -l does show that you have commands in there and are still having problems, post the text of the file here so we can look for errors.
-Scott
Posted by: Nerfbat
Posted on: 2006-04-26 01:09:00
Do managed web hosting (shared) users get access to setting up cron jobs? I need to set one up to run a blog aggregator script every hour (no, it's not shady. It's me and two friends trying to get entries from each of our blogs on the front page of a single blog, while maintaining our independence).
Posted by: doeleman
Posted on: 2006-04-26 01:27:00
In reply to:Do managed web hosting (shared) users get access to setting up cron jobs?
Posted by: silurius
Posted on: 2006-04-26 13:42:00
In reply to:If crontab -l does show that you have commands in there and are still having problems, post the text of the file here so we can look for errors.
Here is what I have currently. These commands do work when I run them manually over SSH (removing the portion before perl first).
0 3 * * * perl /home/EXAMPLEUSER/awstats/tools/awstats_buildstaticpages.pl -config=EXAMPLESITE1.COM -update -awstatsprog=/home/EXAMPLEUSER/awstats/awstats.pl -dir=/home/EXAMPLEUSER/EXAMPLESITE1.COM/awstats/
15 3 * * * perl /home/EXAMPLEUSER/awstats/tools/awstats_buildstaticpages.pl -config=EXAMPLESITE2.COM -update -awstatsprog=/home/EXAMPLEUSER/awstats/awstats.pl -dir=/home/EXAMPLEUSER/EXAMPLESITE2.COM/awstats/
30 3 * * * perl /home/EXAMPLEUSER/awstats/tools/awstats_buildstaticpages.pl -config=EXAMPLESITE3.COM -update -awstatsprog=/home/EXAMPLEUSER/awstats/awstats.pl -dir=/home/EXAMPLEUSER/EXAMPLESITE3.COM/awstats/
Posted by: sdayman
Posted on: 2006-04-26 20:50:00
Use a full path for perl: /usr/bin/perl
-Scott
Posted by: silurius
Posted on: 2006-04-27 13:58:00
In reply to:Use a full path for perl: /usr/bin/perl
Literally, like this? No worky. (Please forgive my infantile Linux/Unix knowlege).
0 * * * * /usr/bin/perl /home/EXAMPLEUSER/awstats/tools/awstats_buildstaticpages.pl -config=EXAMPLESITE1.COM -update -awstatsprog=/home/EXAMPLEUSER/awstats/awstats.pl -dir=/home/EXAMPLEUSER/EXAMPLESITE1.COM/awstats/
15 * * * * /usr/bin/perl /home/EXAMPLEUSER/awstats/tools/awstats_buildstaticpages.pl -config=EXAMPLESITE2.COM -update -awstatsprog=/home/EXAMPLEUSER/awstats/awstats.pl -dir=/home/EXAMPLEUSER/EXAMPLESITE2.COM/awstats/
30 * * * * /usr/bin/perl /home/EXAMPLEUSER/awstats/tools/awstats_buildstaticpages.pl -config=EXAMPLESITE3.COM -update -awstatsprog=/home/EXAMPLEUSER/awstats/awstats.pl -dir=/home/EXAMPLEUSER/EXAMPLESITE3.COM/awstats/
Posted by: matttail
Posted on: 2006-04-27 16:06:00
After you save and exit from editing your cron file, what message do you get? A success message, or something about the time being wrong?
-Matttail
Posted by: sdayman
Posted on: 2006-04-27 16:07:00
If you cut and paste the commands with the full path, does it work?
Did you type in 'crontab -l' to see if you actually have a crontab file?
-Scott
Posted by: silurius
Posted on: 2006-04-27 16:20:00
After editing I get prompted to save, choose yes, get prompted for filename to write (/tmp/crontab.ld88he/crontab) and it saves w/o a problem ('installing new crontab').
If I copy and paste the commands it executes fine (the real commands contain real paths/users).
If I type in 'crontab -l' it does display the same commands as what I see in the editor ('crontab -e').
Posted by: matttail
Posted on: 2006-04-27 16:29:00
I believe that there's an error with your user's setup. It seems everthing is in working order.
However, you should do a few final steps before contacting support. First off put this at the top of your cron file
MAILTO:"you@domain.com"
This will send any error messages you might be getting to your E-mail address. Also, make sure there is at least one blank line at the bottom of your cron file. With these things in place, and if you're sure it's not running - then contact support.
On a side note, there's a easier way to get your commands to run every 15 min besides putting in a new entry. for instance:
*/15 * * * * /usr/bin/perl ....
Will run your command every 15 min. You can also list min if you'd prefer:
2,8,29,45,51 * * * *
Same goes for all the other fields, if you want specific days or whatever.
-Matttail
Posted by: sdayman
Posted on: 2006-04-27 21:23:00
I don't use a MAILTO just because I don't want to hear back from cronjobs.
Does the blank line at the end screw up the whole crontab, or just the last entry?
The crontab this person is setting up is to run awstats on three different domains, hence the three entries.
-Scott
Posted by: matttail
Posted on: 2006-04-28 05:54:00
In reply to:I don't use a MAILTO just because I don't want to hear back from cronjobs.
That's fine once you have them working - but expecially in a situation like this you'd want to know what kind of an error message you're getting.
In reply to:Does the blank line at the end screw up the whole crontab, or just the last entry?
You should have a blank line at the end, as I've heard from others on this forum it seems it's necessary.
In reply to:The crontab this person is setting up is to run awstats on three different domains, hence the three entries.
Didn't catch the different domains.
-Matttail
Posted by: silurius
Posted on: 2006-04-28 09:57:00
Thank you for the suggestions. You've all been extremely helpful.
When I attempt to add the MAILTO to the start of the file (exactly as you showed, with my own yahoo.com address) I get an error upon saving:
"crontab: installing new crontab
"/tmp/crontab.KnLRmM/crontab":0: bad minute
errors in crontab file, can't install.
Do you want to retry the same edit?"
Posted by: matttail
Posted on: 2006-04-28 15:55:00
sorry, that should be
MAILTO="you@domain.com"
Also, I'm not sure, but it may have to be an E-mail address hosted by dreamhost.
-Matttail
Posted by: silurius
Posted on: 2006-04-28 16:19:00
Error received:
"Error: Can't find AWStats program ('awstats.pl').
Use -awstatsprog option to solve this."
As indicated above, I'm referencing awstats.pl via =home/USERNAME/awstats/awstats.pl" which is a valid path and works when I run the same command manually.
0 * * * * /usr/bin/perl /home/EXAMPLEUSER/awstats/tools/awstats_buildstaticpages.pl -config=EXAMPLESITE1.COM -update -awstatsprog=/home/EXAMPLEUSER/awstats/awstats.pl -dir=/home/EXAMPLEUSER/EXAMPLESITE1.COM/awstats/
Posted by: sdayman
Posted on: 2006-04-28 17:25:00
It's possible that your awstats.conf file has an invalid path. Check to see what DirCgi (in your conf file) is pointing to.
-Scott
Posted by: silurius
Posted on: 2006-04-28 18:37:00
DirCgi="/cgi-bin" <--- correct path
Posted by: sdayman
Posted on: 2006-04-28 20:39:00
Really? Your whole awstats package is in /cgi-bin? That's just not how I set mine up. Well, shoot, then I don't know.
[edit]Your earlier post said it's in your $HOME/awstats. As I may have implied, my whole package is in a password protected directory within my domain directory. Since I don't use the same configuration as you, I'm not sure, but it looks like you're trying to refer to two different installation locations. The $HOME/awstats and some /cgi-bin directory.
-ScottEdited by sdayman on 04/28/06 08:43 PM (server time).
Posted by: silurius
Posted on: 2006-04-29 09:10:00
I have an awstats dir in two locations,
/home/EXAMPLEUSER/awstats
and
/home/EXAMPLEUSER/EXAMPLESITE1.COM/awstats
The former contains cgi-bin, data and other directories. The latter contains the JS & graphical stuff.
Not the standard awstats install in their own documentation, but I seem to remember being being guided to it through one of the DH walkthroughs I read.
Posted by: ardco
Posted on: 2006-04-29 15:31:00
>> As indicated above, I'm referencing awstats.pl via =home/USERNAME/awstats/awstats.pl" which is a valid path
> /home/EXAMPLEUSER/awstats
Do you actually have the leading slash (/) in the crontab version? Maybe that's the thing?
You could also use $HOME/awstats...
Good luck,
BobS
Posted by: jbarr
Posted on: 2006-05-11 20:23:00
Anyone have a resolution to this? I followed the AWStats install EXACTLY per the DH Wiki, and I DID get AWStats working...working very well, I might add...but I cannot get crontab to accept the edits detailed in the wiki.
Suggestions?
-Jim
http://JimsTips.com
Posted by: jbarr
Posted on: 2006-05-12 07:52:00
I found that if I use single digit numbers in the crontab parameters such as:
0 2 * * * program
it fails.
If I enter double digit numbers:
00 02 * * * program
it works.
The Wiki should be updated...
Posted by: snokarver
Posted on: 2006-05-12 09:03:00
ahh. I used one digit, but pointed it to a shell script which contained:
[code]#!/bin/bash
/home/user/mysite.com/aw/cgi-bin/awstats.pl -config=mysite.com -update[/code]