FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Cronjob: I Would like to see an example..





Possum
Hi

I believe a cronjob is a script that runs at a set time.

I know very little about them. But want to experiment.

For example how would I do a cronjob that emails me the status of my Frihost points or my data usage.

One of the reasons I think I should know how to do this is so I can send my mobile info about my site.

Thank you..
chatrack
Cronjob can be used to run "somthing.php" script on the server in some preset time interval.

I remember there are videos in youtube which give demo , how to set the url that is to be fired
in selected time intervals
badai
to know your point is pretty simple. no need to use any computer or calculator to do it.

every time you visit forum, just take a look at the top where you can see your point. if it's greater than 45, then it's 45 (system will deduct it to 45). then for each day that you didn't post anything, deduct 1 from your point.

if you think you will lost count, it only mean one thing: you didn't visit the forum for more than 45 days, which defeat the purpose of you having an account here: you need to keep posting to have an account.

i don't know about bandwidth or disk usage. i don't worry much about disk usage because i will know what i have in my account. nobody else can dump anything there. the database usage is negligible. i don't let people upload anything, and few comments (or thousands of comments) won't eat up much of my 500M quota.

but i'm interested about bandwidth. just in case i got Slashdot effect on my website.
badai
to run your php script as cronjob, just use this command

/usr/local/bin/php -q /home/{your_user_name}/domains/{your.doman.name}/public_html/{path_to_your_file}/{your_php_file}

example:

/usr/local/bin/php -q /home/badai/domains/badai.frih.net/public_html/my_file.php

to see the effect, well just create your own php file and let your php send e-mail to you.

the cronjob will also e-mail you if there is any error occur while running your cron.
cr3ativ3
Possum wrote:
Hi

I believe a cronjob is a script that runs at a set time.

I know very little about them. But want to experiment.

For example how would I do a cronjob that emails me the status of my Frihost points or my data usage.

One of the reasons I think I should know how to do this is so I can send my mobile info about my site.

Thank you..


badai wrote:

but i'm interested about bandwidth. just in case i got Slashdot effect on my website.


On the point of measuring bandwidth usage, you can think about how DirectAdmin calculates Bandwidth usage.

It takes logs like HTTP logs, FTP logs, etc... And takes the file size of the page(s) in the log entries and add's them together to calculate the transfer usage.

In your home directory above your public_html folder for each domain, is a folders called logs. In that folder are tar.gz files, if you extract those files they contain HTTP logs. You can then from those logs calculate total HTTP bandwidth usage.

If you really wanted to go about it I suppose you could write a PHP script to do this, not sure if it is really worth it?

Also I do not know how often those log files update so it may be quite futile if you want to monitor live bandwidth usage.

Good Luck anyhow.
Related topics
What can I do with C-Panel?
[*READ THIS FIRST!*] Commonly asked questions
NY Times: A perfect example of lieberals spreading...
Frihost -> CronJob
*[PRZECZYTAJ NAJPIERW]* Czesto Zadawane Pytania, FAQ, TOS.
Cronjobs
Why doesn't my cronjob work?
Need CSS for two tables
How To Show WordPress In Root
Wheel Mouse with Borland Builder C++
heavy cronjob killed by admin?
Help In Setting Up A Cron Job
Python automation [SOLVED]
Paying money for virtual items.. Good or rediculous?
Reply to topic    Frihost Forum Index -> Support and Web Hosting -> Web Hosting Support

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.