Scott Fell
asked on
Script To Check If A Process Is Running On Windows Server 2008 R2
Google drive is on Windows Server 2008 R2. Per google, Drive on a server is not supported and I do run into issues with it stopping and thus not syncing.
What happens is files will be saved locally on the server, but not synced up to drive. When I rdp to the server I can see that several thousand files are not synced. I then start up google drive and syncing starts.
What is the best way to run a script perhaps as an automated task to make sure googledrivesync.exe is running and if not, start it up?
What happens is files will be saved locally on the server, but not synced up to drive. When I rdp to the server I can see that several thousand files are not synced. I then start up google drive and syncing starts.
What is the best way to run a script perhaps as an automated task to make sure googledrivesync.exe is running and if not, start it up?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Awesome! Thank you, I just implemented to run every hour and not duplicate if already running.
Google said they are working on a server version of Google Drive as Drive is not meant to run on a server with multiple people and it does crash now and then. This looks like a good way to make sure it is always running.
Google said they are working on a server version of Google Drive as Drive is not meant to run on a server with multiple people and it does crash now and then. This looks like a good way to make sure it is always running.
Got a slightly shorter version now: https://rcmtech.wordpress.com/2015/07/15/powershell-check-if-a-process-is-running-and-if-not-start-it/
ASKER
Just in case the link ever goes bad the code from above
if((Get-Process -Name notepad -ErrorAction SilentlyContinue) -eq $null){
."C:\Windows\notepad.exe"
}
Open in new window
save it as a .ps1 file and use Windows Task Scheduler to run it as often as you like. You might want to run it elevated (i.e. as an administrator), depends what the sync exe needs.