CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Execute automatically?

 



emelin
stranger

Mar 9, 2001, 2:33 AM

Post #1 of 4 (363 views)
Execute automatically? Can't Post

How can I tell a script to run, let's say, every 6 hours?

I have a script which refreshes contents on my page, and right now it runs when the user clicks the link for the page that is updated... but this is taking too long!

thankful for help
emelin



Jasmine
Administrator / Moderator

Mar 9, 2001, 4:22 PM

Post #2 of 4 (358 views)
Re: Execute automatically? [In reply to] Can't Post

Sounds like cronjobs are just the thing you need. Here's an article on what they are, and how to set them: What is cron and how do I use it?



emelin
stranger

Mar 12, 2001, 1:02 AM

Post #3 of 4 (348 views)
Re: Execute automatically? [In reply to] Can't Post

Thanks... hmmm... don't quite understand the concept...

Let's say I want to do something like this:

1 * * * * path/to/cgi-bin/myfile.cgi
(execute every hour, right?)

Where do I put this?
Do I need to find an existing crontab or can I put this as its own file anywhere, and in that case, what do I call it?



Jasmine
Administrator / Moderator

Mar 12, 2001, 9:57 AM

Post #4 of 4 (341 views)
Re: Execute automatically? [In reply to] Can't Post

For every hour of the day, you need to use

0 * * * * /path/to/cgi-bin/myfile.cgi

Assuming you have cron access, you can put the above line in a file called cronentries.txt (or whatever) and type

crontab cronentries.txt

at your command line. If you don't receive an error, then you're set.

If you have other cron entries, this will delete them. You can see your other cron entries by typing

crontab -l

If there are no entries, then you're safe. If there are, simply add the entries to your cronentries.txt file (one entry per line) and then type the crontab cronentries.txt to include all of the entries.

Hope this helps!


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives