Hourly Cron job for windows

How can I schedule a cron job to run every hour?

I'd like to be able to be more sophisticated and run this job once every hour during working hours on monday through friday but that'll do for now
LVL 3
jayrodAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

☠ MASQ ☠Commented:
Host dependent but, for example ...

Via the "crontab" command from the shell.
crontab -l will show you your currently set up cron jobs on the server.

crontab -r will delete your current cron jobs.

crontab -e will allow you to add or edit your current cron jobs by using your default text editor to edit your "crontab file".

Your crontab includes all the cron jobs you'd like, with one cron entry per line. A cron entry looks like this:

45 2 * * *     /home/user/script.pl



The first number is the minute of the hour for the command to run on.
The second number is the hour of the day for the command to run on.
The third number is the day of the month for the command to run on.
The fourth number is the month of the year for the command to run on.
The fifth number is the day of the week for the command to run on.
Here are some examples to help you learn the syntax for the numbers:

32 * * * * : will be run every hour on the 32nd minute.
12,42 * * * * : will be run twice an hour on the 12th and 42nd minutes.
*/15 */2 * * *: will be run at 0:00, 0:15, 0:30, 0:45, 2:00, 2:15, 2:30, ...
43 18 * * 7: will be run at 6:43pm every Sunday.
jayrodAuthor Commented:
sorry I needed this on a windows platform.. sorry for wasteing your brain cycles.
☠ MASQ ☠Commented:
Sorry, crons are strictly linux. Could you put it into scheduler?
HTML5 and CSS3 Fundamentals

Build a website from the ground up by first learning the fundamentals of HTML5 and CSS3, the two popular programming languages used to present content online. HTML deals with fonts, colors, graphics, and hyperlinks, while CSS describes how HTML elements are to be displayed.

DexstarCommented:
@jayrod:

> I'd like to be able to be more sophisticated and run this job once every hour
> during working hours on monday through friday but that'll do for now

In Windows, it is called the AT command.  "AT /?" at a command line to see the parameters...  Say you want to run "C:\DoIt.bat" on the computer SOMESERVER every hour Monday through Friday.  You'll have to issue these commands:

     AT \\SOMESERVER 8:00 /EVERY:Monday,Tuesday,Wednesday,Thursday,Friday "C:\DoIt.bat"
     AT \\SOMESERVER 9:00 /EVERY:Monday,Tuesday,Wednesday,Thursday,Friday "C:\DoIt.bat"
     AT \\SOMESERVER 10:00 /EVERY:Monday,Tuesday,Wednesday,Thursday,Friday "C:\DoIt.bat"
     AT \\SOMESERVER 11:00 /EVERY:Monday,Tuesday,Wednesday,Thursday,Friday "C:\DoIt.bat"
     AT \\SOMESERVER 12:00 /EVERY:Monday,Tuesday,Wednesday,Thursday,Friday "C:\DoIt.bat"
     AT \\SOMESERVER 13:00 /EVERY:Monday,Tuesday,Wednesday,Thursday,Friday "C:\DoIt.bat"
     AT \\SOMESERVER 14:00 /EVERY:Monday,Tuesday,Wednesday,Thursday,Friday "C:\DoIt.bat"
     AT \\SOMESERVER 15:00 /EVERY:Monday,Tuesday,Wednesday,Thursday,Friday "C:\DoIt.bat"
     AT \\SOMESERVER 16:00 /EVERY:Monday,Tuesday,Wednesday,Thursday,Friday "C:\DoIt.bat"
     AT \\SOMESERVER 17:00 /EVERY:Monday,Tuesday,Wednesday,Thursday,Friday "C:\DoIt.bat"
     AT \\SOMESERVER 18:00 /EVERY:Monday,Tuesday,Wednesday,Thursday,Friday "C:\DoIt.bat"

Let me know if you have any problems.

Hope That Helps,
Dex*

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
e_sandrsCommented:
Great info from Dex already.  I'd just expand to note, if this helps you, that on WinXP and/or Win2k3 Server you can use the command "SCHTASKS" instead of "AT".  On Win2k Server, you only have "AT".

Nice, printable help files are available from Start -> Help, searching for "command at", for example.

Eric Sanders
-Just some guy on a board.
shivsaCommented:
Windows has a builtin "AT" command with similar functionality.

The Windows resource kit contains a GUI version called "WinAt". u may find it very helpful.

this is a example to run job at 8:00 am in the morning for monday to friday.

at 8:00 /every:Mo,Tu,We,Th,Fr, do_something

u may put in a for look in a bat file or copy the same file for wach hour as Dex suggested above.
 
Once u are done You have to set the "Schedule" service to start automatically though because it does not start by default.

Start > Settings > Control Panel > Services > Highlight Schedule > Click Start > Now Click Startup > Click Automatic > OK
Note you can configure it to be automatically started when you boot your machine.

also winat is quite good.u can download it from here.
tp.etl.go.jp/oldpub/windows/win32app/winat.exe
ftp.nasda.go.jp/pub/OS/ms-Windows/win32app/winat.exe
ftp.etl.go.jp/pub/windows/win32app/winat.exe
-----------
 
anupnellipCommented:
it is simple go to Programs - accessories - system tools - Scheduled Tasks
in that u can run the wizard or do it manually to select the job u want to run  , select advanced to schedule every hour . There are whole lot of options to set there !

 
jayrodAuthor Commented:
Thanks for all of the help you all :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Operating Systems

From novice to tech pro — start learning today.