Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a job that needs to go off every minute or so,

it loads a DLL i have written in C# that retrieves state for an SQL Server Mirror (Primary, Mirror and witness) for a number of databases;

it allows us to poke DNS to show where the primary instances are. Please don't mention Clustering - We're not doing that.

I can't be arsed to write a service, there simply isn't enough time

do I

  • Task Scheduler - every minute: Invoke a powershell script that loads the DLL does the business
  • Task scheduler - At Startup : Invoke a similer powershell script that loads the DLL once but then loops and sleeps, refreshing the Object that the DLL exposes.

Pros and cons?

share|improve this question
    
If you can't be 'arsed' then why should we be 'arsed' to help? –  Dave Rook Nov 27 '12 at 10:44
    
Timescales, It could and should be done but I've never written a C# service and the deadline approaches like the grim reaper..... –  Paddy Carroll Nov 27 '12 at 10:54
add comment

1 Answer 1

up vote 2 down vote accepted

Powershell is a heavy thing to load every minute for a small task. You can create mass swap in this way. From this point of view the second approach looks a little bit better. But in the second case monitoring this job if it is running or not will be your problem.

So, if you have enough cache memory to fit powershell with its dependencies - try the first option. If not - stick with the second. And think of writing service anyway :)

share|improve this answer
    
I shall write the service - but not this week. Thanks! –  Paddy Carroll Nov 27 '12 at 16:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.