Uninterruptible Power supply

Windows specific questions, problems.
Post Reply
dVol
Newbie
Newbie
Posts: 2
Joined: Wed Jul 22, 2020 5:48 pm

Uninterruptible Power supply

Post by dVol » Wed Jul 22, 2020 6:19 pm

I have a UPS attached to my Windows 10 qBittorrent PC and it issues the windows command " shutdown /f " before it runs out of battery -- which directs windows to force running applications to close.

Does anybody know whether qBittorrent listens for the shutdown command and runs it's own shutdown procedures before closing?

Thanks.

User avatar
Peter
Administrator
Administrator
Posts: 1848
Joined: Wed Jul 07, 2010 6:14 pm

Re: Uninterruptible Power supply

Post by Peter » Thu Jul 23, 2020 8:08 pm

Well it listens to the command, but it will try writing out data that's cached. If you have "shutdown /s", it will write everything out, BUT delay shutdown if it has to write out a lot of data. That said.... you either have a fast enough internet - so you won't have lot of stuff downloading while this happens (it's downloading and you go AFK/go to sleep) OR you have slow connection which case qBittorrent can write everything out fast.

dVol
Newbie
Newbie
Posts: 2
Joined: Wed Jul 22, 2020 5:48 pm

Re: Uninterruptible Power supply

Post by dVol » Fri Jul 24, 2020 3:26 am

Hi Peter. Thank you for your response.

Great news that QB listens for a shutdown command. Great software. Thank you!

Initially I was confused when you mentioned /s rather than /f but I see that the full command: [shutdown /s /f /d UP:6:12 /c "PowerChute Business Edition has initiated a system shutdown."] has both /s and /f so I’m guessing that QB will respond appropriately to the full command.

My UPS typically has a 90 minute runtime and QB takes about 30 seconds to shut down, so I don’t expect a problem there, but I’m unclear how the shutdown command works and whether it will wait for QB to shut down cleanly before turning off the PC. Do you know about that?

I'm not too concerned about losing torrent pieces that I may have downloaded, but I am concerned about getting into a situation where QB wants to verify a lot of torrents on startup. It hasn't happened to me for a long time, but since I now have 23,000 torrents loaded, albeit mostly paused, I would like to avoid it if possible.

Thanks again for your kind help,
Dennis

User avatar
Peter
Administrator
Administrator
Posts: 1848
Joined: Wed Jul 07, 2010 6:14 pm

Re: Uninterruptible Power supply

Post by Peter » Sat Jul 25, 2020 7:27 am

Now hol' up.

shutdown /s

Will do a clean shutdown. It will wait for apps to close.

shutdown /s /f

Will do a FORCED shutdown. Every app will be kicked instantly - thus qBittorrent will have no chance to write out anything.
Honestly, I'd do it like this:
ON POWER LOSS
1) Issue a "shutdown /s" (NO /F!).
2) Issue a "shutdown /s /f" after like few minutes passed.

I think you can do this in Task Scheduler.
Ie.:
- Create Task
- Triggers:
-- On an Event
-- Add the UPS event
-- And you can "delay task" over there in that dialog too.
- And now you just add shutdown as command.

MAYBE you can just keep your command (REMOVE /F!) and add the /F toggle to Task Scheduler. Just in case your PC _has to_ shut down, it should shut down no matter what. But before it does that, let it do a clean shutdown. Sometimes apps will not close without /F, like even if you have Notepad open with an unsaved document because well, you'd lose the document. But this is just the way to do it IMO.

Post Reply