How do I schedule a cron job?
I am not new to linux; been using Debian for about 3 or 4 years now. But I have never once made my own cron job. The need never really came up.
Today I was interested in finding out statistics about my web server (what's been going on for the past few years) so I installed awstats and got it running to my liking. Only, i have to run a command at the prompt in order to have the stats update (there's an option to allow updates from the awstats page from a browser, but i dont feel comfortable doing it this way because my stats page is publically viewable) and I can't seem to figure this cron stuff out so it does it for me.
I found this website ( http://www.debian-administration.org/articles/56 ) and it taught me a few things, but I am still unclear on what exactly to do. There is specifically 3 commands I want to have run every hour (it updates stats for 3 sites), and they are as follows:
I thought about writing a shell script to hold all 3 of these commands and putting the shell script in /etc/cron.hourly/ but I read on the above pasted link about the crontab thing... and now I am confused.
Should I set this up somehow with the crontab program? If so, how should I do it? Or, should I put a shell script in /etc/cron.hourly/ ? If so, are there any specifics I should know about before hand (like do I need to manually start the script after putting it in there, etc)?
Sorry, for making the post so long, but I like to give as many details as possible.
Here are the Server stats I am running this on:
AWStats 6.5 (downloaded source from sourceforge [apt installed an incomplete awstats so it seemed] )
Any other info needed, just ask.
Thanks in advance for all your help! :)
put your commands in a crontab file:
0 0-23 * * * /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -config=billy.pl3x.net -update
(that's all one line for one command...you'll need to duplicate it for your other commands)
edit a text file, put that command in it, then tell cron about your text file.
Somehting like this:
use crontab -l to verify
|All times are GMT -5. The time now is 06:17 PM.|