Author Topic: Don't shutdown when queue is not empty  (Read 3839 times)

Offline Avatar

  • Contributor
  • ***
  • Posts: 11
Don't shutdown when queue is not empty
« on: September 20, 2014, 03:10:43 am »
My ISP allows free download from 2am to 8am and shuts down PC when finished downloading. I scheduled the task from 2 to 8am with full download (green). However I found a few times that it stops half way or download a few GB and shutdown. I found the speed of my newsgroup provider sometime drops to zero and starts up again. I suspect the program shuts down PC when speed goes to zero. It shuts down the computer even speed comes up again later. Is it the case or am I missing something? TIA.

Offline Hecks

  • Contributor
  • ***
  • Posts: 2011
  • naughty cop
Re: Don't shutdown when queue is not empty
« Reply #1 on: September 20, 2014, 04:36:29 am »
Do you mean you're using Windows Task Scheduler to invoke Alt.Binz? How have you configured the Task to respond to idle state, what sleep/hibernate options have you set, do you start Alt.Binz with Autopush Shutdown Button, and what have you configured in Setup > Miscellaneous #2 (standby mode/shutdown method)?

A bit more info, please, as there are different ways of doing this.
« Last Edit: September 20, 2014, 04:42:22 am by Hecks »

Offline Avatar

  • Contributor
  • ***
  • Posts: 11
Re: Don't shutdown when queue is not empty
« Reply #2 on: September 20, 2014, 03:05:24 pm »
Thanks for the reply. Yes I use Task Scheduler. It works half of the time. I actually setup Altbinz first(Queue all files, pushed both schedule and shutdown buttons) and just use Task Scheduler to turn on the PC at 1:59am. Only action in task scheduler is to start Altbinz which is started already before I put the PC to sleep.
The thing is that it works but it's a hit and miss. I found the newsgroup provider speed is up and down sometime so I figure may be that's the cause.

Offline Hecks

  • Contributor
  • ***
  • Posts: 2011
  • naughty cop
Re: Don't shutdown when queue is not empty
« Reply #3 on: September 20, 2014, 04:52:03 pm »
So sounds like when your dl speed drops to zero, your PC goes into idle mode and triggers any sleep/shutdown timers. You can look through your Event Viewer log and compare with Alt.Binz log times for more info.

The first thing to check & test is:

Alt.Binz > Setup > Miscellaneous #2 > 'Prevent entering standby'

If that doesn't work, report back here. I have a script to control Alt.Binz downloads overnight via its altbinz_status.xml file, but let's try the above first.

Offline Avatar

  • Contributor
  • ***
  • Posts: 11
Re: Don't shutdown when queue is not empty
« Reply #4 on: September 20, 2014, 05:51:14 pm »
Thanks Hecks. Will definitely try it out. Will run it for a couple of days and see if it is consistent too. I never try that 'Prevent entering standby' as I thought it will prevent Altbinz to go standby/sleep. Thanks again.

Offline Hecks

  • Contributor
  • ***
  • Posts: 2011
  • naughty cop
Re: Don't shutdown when queue is not empty
« Reply #5 on: September 20, 2014, 07:06:16 pm »
You can combine it with Shutdown mode and Autopush Shutdown button, etc., to tweak the behaviour you want.

Another alternative is just to change your standby timer(s) in Windows power settings - say, to 30 mins?

Offline Hecks

  • Contributor
  • ***
  • Posts: 2011
  • naughty cop
Re: Don't shutdown when queue is not empty
« Reply #6 on: September 20, 2014, 07:52:26 pm »
Also, while we're on the subject, here's a Windows Powershell script that, when run via a task, will toggle the Alt.Binz Connect button, loop for as long as the queue isn't empty, then disconnect.

First you need to check Setup > Miscellaneous #2 > 'Enable status in XML file'

Code: [Select]
## monitor-altbinz.ps1 ##

$abstatusxml = join-path $home "\AppData\Local\Alt.Binz\altbinz_status.xml"
$abstatus = {[xml] (get-content $abstatusxml)}
   
function Log-DateTime
{
    get-date -format "dd/MM/yyyy HH:mm:ss"
}

function Connect-Altbinz
{
    write ((Log-DateTime) + " Connecting Altbinz ................")
    $abstat = &$abstatus
    if ($abstat.altbinz.connect -imatch "false") {
        $abstat.altbinz.connect = "true" ;
        try {$abstat.save($abstatusxml)} catch {sleep 3; $abstat.save($abstatusxml)}
    }
}

function Disconnect-Altbinz
{
    write ((Log-DateTime) + " Disconnecting Altbinz .............")
    $abstat = &$abstatus
    $abstat.altbinz.connect = "false" ;
    try {$abstat.save($abstatusxml)} catch {sleep 3; $abstat.save($abstatusxml)}
}

function Get-DownloadStatus
{
    write ((Log-DateTime) + " Checking AB download status .......")
    $queue = (&$abstatus).altbinz.queuesize
    write ((Log-DateTime) + " Starting queue: " + $queue)
    $start = get-date
    while (-not ((&$abstatus).altbinz.queuesize -eq "0.00 MB")) {
        sleep 60
        $speed = (&$abstatus).altbinz.currentspeed
        write ((Log-DateTime) + " Download speed: " + $speed)
        $queue = (&$abstatus).altbinz.queuesize
        write ((Log-DateTime) + " Queue size: " + $queue)
    }
    $span = new-timespan $start (get-date)
    $duration = ("" + $span.hours + "h " + $span.minutes + "m " `
                    + $span.seconds + "s")
    write ((Log-DateTime)  + " Total duration: " + $duration)
}

function Log-Errors
{
    $log = {foreach ($e in $error) {write $e
    write "--------------------------------------------------"}}
    &$log | out-file (join-path $home "\Desktop\pserrors.log") -width 50
}

Connect-Altbinz
sleep 10
Get-DownloadStatus
Disconnect-Altbinz
sleep 10
if ($error -ne $null) {Log-Errors}
Exit


To enable running your own Powershell scripts, run this command once from a Powershell window:

Code: [Select]
set-executionpolicy remotesigned

Offline Avatar

  • Contributor
  • ***
  • Posts: 11
Re: Don't shutdown when queue is not empty
« Reply #7 on: September 21, 2014, 01:57:51 am »
Wow. You are the man. I will check this out tonight.