From 85500dcec4dca2e1db0ae90e370b003ac439963f Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Thu, 27 Oct 2016 19:10:33 -0700 Subject: [PATCH] Format and screenshots for Windows Task Scheduler --- Install-as-a-daemon.md | 65 +++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 29 deletions(-) diff --git a/Install-as-a-daemon.md b/Install-as-a-daemon.md index 6958a95..e0d8891 100644 --- a/Install-as-a-daemon.md +++ b/Install-as-a-daemon.md @@ -2,42 +2,49 @@ These steps are presented as guidelines. Your results may vary, depending on ope ## Windows -Interactive -This will start PlexPy when you login to Windows without the command prompt. +### Interactive +This will start PlexPy in the background when you login to Windows without the command prompt. * Make sure PlexPy is shutdown. `PlexPy > Settings > Shutdown` * Create a new shortcut ([screenshot](http://i.imgur.com/CBA2D6f.png)) in your startup folder with - * Target: `C:\Python27\pythonw.exe C:\Path\to\PlexPy\PlexPy.py` + * Target: `C:\Python27\pythonw.exe C:\PlexPy\PlexPy.py` * Start in: `C:\Python27` * Start PlexPy with the shortcut -Non Interactive -Command File -Create the following command file named (C:\PlexPy\PlexPy.CMD): -Start C:\Python27\pythonw.exe C:\PlexPy\PlexPy.py -Open Task Scheduler (%windir%\system32\taskschd.msc) and create the following Task: -* Name = PlexPy -* Run As = Administrator -* Run When = Whether user is logged on or not. -* Configure For = Windows X (Mine = Windows 10) -* Trigger = At Startup -* Delay Task for = 30 Seconds (This allows the server to load its things first) -* Actions = Start a program -* Program/Script = C:\PlexPy\PlexPy.CMD -* Conditions = Wake the computer to run this task (Probably not necessary) -Settings -* Allow task to be run on demand = True -* Run task as soon as possible after scheduled start is missed = True -* If the task fails, restart every = True (1 Minute) -* Attempt to restart up to = 3 Times -* If the running task does not end when requested, force it to stop = True -* If the task is already running, then the following rule applies = Do not start a new instance. +### Non Interactive +This will start PlexPy in the background when your computer starts, regardless of whether you are logged in. -You should always see the Task result The operation completed successfully (0x0) and should never be in a infinite Running state. -When you check the task manager you should see a pythonw (32 bit) background process running. -If the process stopped unexpectedly you are able to restart it remotely with PowerShell command: -(Test PS Remoting by using this command; Test-WSMan -ComputerName PlexPyServer) -Invoke-Command -ComputerName PlexPyServer -Credential Administrator -ScriptBlock {start-ScheduledTask -TaskName PlexPy} +* Make sure PlexPy is shutdown. `PlexPy > Settings > Shutdown` +* Create a new text file and [enter the following line](https://i.imgur.com/KYT8rCM.png): `Start C:\Python27\pythonw.exe C:\PlexPy\PlexPy.py` +* Save the file in your PlexPy folder as `PlexPy.cmd` (e.g. `C:\PlexPy\PlexPy.cmd`) +* Open the "Run" dialog window (Win+R) and run `%windir%\system32\taskschd.msc` to open your Windows Task Scheduler. +* Create a new task with the following settings: + * [General](https://i.imgur.com/Hr0Hf6i.png): + * Name: PlexPy + * (•) Run whether user is logged on or not + * Configure for: Windows 10 (select your own Windows version) + * [Triggers](https://i.imgur.com/UZJYxsk.png): + * Add a new trigger: + * Begin the task: At startup + * [✓] Delay task for: 30 seconds (to allow your server to start up, adjust as necessary) + * Click OK + * [Actions](https://i.imgur.com/QsfV2SO.png): + * Add a new action: + * Action: Start a program + * Program/script: `C:\PlexPy\PlexPy.cmd` + * Click OK + * [Settings](https://i.imgur.com/N51JmMb.png): + * [✓] Allow task to be run on demand + * [✓] Run task as soon as possible after a scheduled start is missed + * [✓] If the task fails, restart every: 1 minute + * Attempt to restart up to: 3 times + * [✓] If the running task does not end when requested, force it to stop + * If the task is already running, then the following rule applies: Do not start a new instance + * Click OK +* PlexPy should show up in the [list of Active Tasks](https://i.imgur.com/eE3I25I.png). +* Double click on the task, then [click "Run" on the right hand side](https://i.imgur.com/Ms3JHif.png). The status will change the "Running". +* Once PlexPy has started, the [status should change back to "Ready" and the last run result should say "The operation completed successfully (0x0)"](https://i.imgur.com/6wCl9F4.png). +* In your Windows Task Manager, there should be a ["pythonw.exe" background process running](https://i.imgur.com/y92k9zb.png). ## Ubuntu This installation assumes PlexPy is installed to `/opt/plexpy`. Make sure all paths are correct and accessible. A common mistake is that a daemon user has no read and/or write permissions.