Cron

design

#1

I’ve never cron’d before. I would like a process to check the server’s uptime and any other stats I can get on it. I would also like the cron to check my site stats. Has anyone written that already??

Thanks


#2

Crontab itself does not do anything. It just calls up some scripts every minute, hour, day, month, or year depending on your setting. You can read this tutorial to learn more about Crontab.

If you want to check your site stats, you may want to check AWStats. The tutorial teaches you how to set up crontab job for AWStats as well.

$50 off and 3 free domains with code: [color=#CC0000]DH3[/color] Sign Up NOW or More Codes Here


#3

Not really like you want, but you can put in your cron.
@daily uptime
@daily w
And by mail to your user or you can tell cron to which user send it will send the outpout of that commands… say some like:
w
09:19:23 up 3 days, 1:38, 1 user, load average: 0.02, 0.12, 0.13

Maybe it works for you.
Ah, I need to point that Debian had done a very good job tweaking cron, so there are some ways to put easier crontabs, from man 5 crontab:
Instead of the first five fields, one of eight special strings may
appear:

string meaning


@reboot Run once, at startup.
@yearly Run once a year, “0 0 1 1 *”.
@annually (same as @yearly)
@monthly Run once a month, “0 0 1 * *”.
@weekly Run once a week, “0 0 * * 0”.
@daily Run once a day, “0 0 * * *”.
@midnight (same as @daily)
@hourly Run once an hour, “0 * * * *”.

Now that you mention, if you want to know when the server you are reboots put a echo “I been restarted” on a crontab @reboot :smiley: it’s a nice way to know.

use VIC3M to get 50USD discount on all plans +10% on storage and bandwith, VICM3 to get the maximum disscount on sign up.