Windows service - Nightly task

  • Thread starter Thread starter arun.hallan
  • Start date Start date
A

arun.hallan

Hi,

I want to run a webservice method every night at a specified time, say
10pm.

The current way i thought of doing this is to have a windows service
and a timer which checks the time every minute and when it gets to
10:00 it fires off the webmethod.

Is this the best way to do it? If not, does anyone have any
suggestions?

Thanks,
Arun
 
Arun,

This would be overkill.

What you should do is create a command line exe which will make the call
once, and then do whatever work you need it to do.

Then, create a scheduled task to run every night at 10 PM and have it
call your executable.

Hope this helps.
 
Thanks Nicholas.

Are there any reliability issues around windows services?


Arun,

This would be overkill.

What you should do is create a command line exe which will make the call
once, and then do whatever work you need it to do.

Then, create a scheduled task to run every night at 10 PM and have it
call your executable.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hi,

I want to run a webservice method every night at a specified time, say
10pm.

The current way i thought of doing this is to have a windows service
and a timer which checks the time every minute and when it gets to
10:00 it fires off the webmethod.

Is this the best way to do it? If not, does anyone have any
suggestions?

Thanks,
Arun
 
Not really, but what's the point of having a process run (the service)
that is going to do nothing except for a very small part of the day?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Thanks Nicholas.

Are there any reliability issues around windows services?


Arun,

This would be overkill.

What you should do is create a command line exe which will make the
call
once, and then do whatever work you need it to do.

Then, create a scheduled task to run every night at 10 PM and have it
call your executable.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hi,

I want to run a webservice method every night at a specified time, say
10pm.

The current way i thought of doing this is to have a windows service
and a timer which checks the time every minute and when it gets to
10:00 it fires off the webmethod.

Is this the best way to do it? If not, does anyone have any
suggestions?

Thanks,
Arun
 
Sorry i meant to say are there any reliability issues around scheduled
tasks?
Not really, but what's the point of having a process run (the service)
that is going to do nothing except for a very small part of the day?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Thanks Nicholas.

Are there any reliability issues around windows services?


Arun,

This would be overkill.

What you should do is create a command line exe which will make the
call
once, and then do whatever work you need it to do.

Then, create a scheduled task to run every night at 10 PM and have it
call your executable.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hi,

I want to run a webservice method every night at a specified time, say
10pm.

The current way i thought of doing this is to have a windows service
and a timer which checks the time every minute and when it gets to
10:00 it fires off the webmethod.

Is this the best way to do it? If not, does anyone have any
suggestions?

Thanks,
Arun
 
Not that I know of. The time comes around, it runs the task. It's
pretty simple, actually. I think you have to worry more about something
going wrong in your code rather than the code that schedules the task.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Sorry i meant to say are there any reliability issues around scheduled
tasks?
Not really, but what's the point of having a process run (the service)
that is going to do nothing except for a very small part of the day?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Thanks Nicholas.

Are there any reliability issues around windows services?



Nicholas Paldino [.NET/C# MVP] wrote:

Arun,

This would be overkill.

What you should do is create a command line exe which will make
the
call
once, and then do whatever work you need it to do.

Then, create a scheduled task to run every night at 10 PM and have
it
call your executable.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hi,

I want to run a webservice method every night at a specified time,
say
10pm.

The current way i thought of doing this is to have a windows service
and a timer which checks the time every minute and when it gets to
10:00 it fires off the webmethod.

Is this the best way to do it? If not, does anyone have any
suggestions?

Thanks,
Arun
 
One thing to watch out for is the user that runs the scheduled task.
When you set up the scheduled task it will run as a specific user and
you have to specify an account with password. If you use a real
user's account and have expiring passwords, then the scheduled task
will stop running as soon as the user changes his/her password.

To get around this try creating an account specified to this task or
to scheduled tasks in general (with appropriate minimum permissions)
and no expiring password.

It's also good to use a separate account so you don't wonder why Arun
is logging in every day at 10pm, doesn't he have a life? :-)

Finally you want to make sure you save the output from your scheduled
task to a file. Do this in the command line like:

c:\ScheduledApp\ScheduledApp.exe >>c:\ScheduledApp\Log.txt

HTH,

Sam
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top