Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cron

Status
Not open for further replies.

Zas

Programmer
Oct 4, 2002
211
US
whats a good cron program, and how can i run it ( possibly from my server, or last possibility my comp ).
I want to run it hourly, every day. Happieness is like peeing your pants.
Everyone can see it, but only you can feel the warmth.
 
Strange question, not sure what you mean. "cron" is a good cron program :)
See "man crontab" for setting up jobs.
Here's an example crontab entry that will run on the hour:
0 * * * * echo "hello world" > /tmp/hello.out 2>&1
 
errr. let me start over.
I need a "crontab" program.
I have a script that I want to execute every hour and it is at the website How can I get a "crontab" program that will do this for me, and is free.
And if possible, I would like to do this on the server (so my computer is not on 24/7). Maybe? Thanks. Happieness is like peeing your pants.
Everyone can see it, but only you can feel the warmth.
 
I'm assuming the server is Unix. "crontab" comes with cron. There is nothing for you to get, it's all already there.

Let's assume your program you need to run on the hour is "/home/zas/doit".
Steps:
1) Edit a file (/home/zas/cronjobs.txt say) and add this:
0 * * * * /home/zas/doit > /tmp/doit.out 2>&1
2) Run "crontab /home/zas/cronjobs.txt"
3) Sit back and have a beer

 
.... ? confused ?
i mean how can i run it from like "netfirms.com"
i really donot know a lot about unix, all i know is it has something to do about cron. Happieness is like peeing your pants.
Everyone can see it, but only you can feel the warmth.
 
what if i'm using windows? Happieness is like peeing your pants.
Everyone can see it, but only you can feel the warmth.
 
19:38:00 2540 Start: 19:38:00 2540 Start result: 0
19:39:00 2024 Start: 19:39:00 2024 Start result: 0
19:40:00 236 Start: 19:40:00 236 Start result: 0
19:41:00 2900 Start: 19:41:00 2900 Start result: 0
19:42:00 1872 Start: 19:42:00 1872 Start result: 0
19:43:00 1772 Start: 19:43:00 1772 Start result: 0


Why is it 0, and hows come when I goto the link, it works, but when cron does it, it doesn't work! Why? Happieness is like peeing your pants.
Everyone can see it, but only you can feel the warmth.
 
You can't run a URL directly as a command. You are going to need to write a program that will do it for you, and then call that program.

You can write your program in Perl (and probably a lot of other languages too). Look on the web, someone may have already written something. Getting this program working is your first job, worrying about cron or any other scheduler comes later.
 
I have it working. I sent it to a link C:/url.html, I redirected it too my and than closed the page automaticly. Thanks for the help.

======
Closed
====== Happieness is like peeing your pants.
Everyone can see it, but only you can feel the warmth.
 
Get a copy of wget for windows. Write a .bat/.cmd that takes care of any wget parameters, then use the windows scheduler (assuming you're using a modern version of windows). If you're using an older version of windows, wincron should be available from tucows I would think.
 
lynx is for links? that would of been useful. Happieness is like peeing your pants.
Everyone can see it, but only you can feel the warmth.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top