Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista Tutorial - execute command on remote system

Reply
 
Old 11-30-2007   #1 (permalink)
Justin Rich
Guest


 
 

execute command on remote system

i have a script that does a db backup and then copies itself over to another
system when it gets to that system i'd like to run a db check on the file to
verify it moved successfully.

i cant run the db check from the DB server because it will basically pull
all the data back over so basically i'd like to run one script on the DB
server that does the backup and pushes it off and then another script one
the backup server that verifies the file copied correctly.

so basically how can i make the script on the backup server run as soon as
the script on the db server finishes?

Thanks
Justin



My System SpecsSystem Spec
Old 11-30-2007   #2 (permalink)
Marco Shaw [MVP]
Guest


 
 

Re: execute command on remote system

Justin Rich wrote:
Quote:

> i have a script that does a db backup and then copies itself over to another
> system when it gets to that system i'd like to run a db check on the file to
> verify it moved successfully.
>
> i cant run the db check from the DB server because it will basically pull
> all the data back over so basically i'd like to run one script on the DB
> server that does the backup and pushes it off and then another script one
> the backup server that verifies the file copied correctly.
>
> so basically how can i make the script on the backup server run as soon as
> the script on the db server finishes?
>
> Thanks
> Justin
>
>
Is there a way for the backup server to track on which DB server the
script is running on?

What I'm thinking is that script would create a temporary lock file when
starting, then delete it when done.

The script from the backup server will then loop for seconds, minutes,
hours depending on how long the script usually takes, and will check for
that temporary lock file. When the lock file is gone, then the script
runs whatever checks it needs to do. Then you can also use that to
watch for the lock file, and if the lock file remains for too long,
something might be locked up/running away.

That's if I'm following you properly...

Marco

--
Microsoft MVP - Windows PowerShell
http://www.microsoft.com/mvp

PowerGadgets MVP
http://www.powergadgets.com/mvp

Blog:
http://marcoshaw.blogspot.com
My System SpecsSystem Spec
Old 11-30-2007   #3 (permalink)
Justin Rich
Guest


 
 

Re: execute command on remote system

you are, but i just had another idea that popped in to my head as i was
looking at a schedule task i have.

I think i can easily use AT or schtasks to create a remote job and just grab
the time and add 5 min to it and schedule the task for then. that way im not
constantly probing the server. Also once the script on the backup server
completes i can have it delete the task.

havent tried it yet since i just thought of it, but i suspect it should work
well.

Justin

"Marco Shaw [MVP]" <marco.shaw@_NO_SPAM_gmail.com> wrote in message
news:uSfyXU1MIHA.5400@xxxxxx
Quote:

> Justin Rich wrote:
Quote:

>> i have a script that does a db backup and then copies itself over to
>> another system when it gets to that system i'd like to run a db check on
>> the file to verify it moved successfully.
>>
>> i cant run the db check from the DB server because it will basically pull
>> all the data back over so basically i'd like to run one script on the DB
>> server that does the backup and pushes it off and then another script one
>> the backup server that verifies the file copied correctly.
>>
>> so basically how can i make the script on the backup server run as soon
>> as the script on the db server finishes?
>>
>> Thanks
>> Justin
>
> Is there a way for the backup server to track on which DB server the
> script is running on?
>
> What I'm thinking is that script would create a temporary lock file when
> starting, then delete it when done.
>
> The script from the backup server will then loop for seconds, minutes,
> hours depending on how long the script usually takes, and will check for
> that temporary lock file. When the lock file is gone, then the script
> runs whatever checks it needs to do. Then you can also use that to watch
> for the lock file, and if the lock file remains for too long, something
> might be locked up/running away.
>
> That's if I'm following you properly...
>
> Marco
>
> --
> Microsoft MVP - Windows PowerShell
> http://www.microsoft.com/mvp
>
> PowerGadgets MVP
> http://www.powergadgets.com/mvp
>
> Blog:
> http://marcoshaw.blogspot.com

My System SpecsSystem Spec
Old 11-30-2007   #4 (permalink)
Marco Shaw [MVP]
Guest


 
 

Re: execute command on remote system

Justin Rich wrote:
Quote:

> you are, but i just had another idea that popped in to my head as i was
> looking at a schedule task i have.
>
> I think i can easily use AT or schtasks to create a remote job and just grab
> the time and add 5 min to it and schedule the task for then. that way im not
> constantly probing the server. Also once the script on the backup server
> completes i can have it delete the task.
>
> havent tried it yet since i just thought of it, but i suspect it should work
> well.
Use AT since you won't have to worry about any cleanup after...

Marco
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
The command failed to execute Vista mail
Windows Mail Command "The Command Failed To Execute" Vista mail
Command failed to execute Vista mail
command : execute Vista General
Execute a command in a string PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46