Author Topic: pause downloads if download folder disspears  (Read 2788 times)

Offline teenhype90210

  • Contributor
  • ***
  • Posts: 7
pause downloads if download folder disspears
« on: January 31, 2012, 10:34:51 am »
I have the default download folder on a mapped network location (my home server), and it has to reboot every evening (no way around it).  The problem I'm running into is I have alt.binz downloading almost 24/7 every day, but it catches that the mapped location has dissapeared while the server is rebooting, defaults back to a local drive and continues downloading to the local folder until i go in and manually reset the default location.  Is there a way to disable this behavior? Maybe force it to just pause downloading if the location cannot be found, and resume when the connection is restored?  I would think this would benefit other individuals as well.

Offline Rdl

  • Administrator
  • *****
  • Posts: 4050
Re: pause downloads if download folder disspears
« Reply #1 on: January 31, 2012, 01:15:00 pm »
I'm not sure if this would benefit others. You have unique situation there.

Here's the solution for you:
-before restarting server, make it execute script. In that script you'll modify altbinz_status.xml file where you'll force altbinz to disconnect (make sure you enable that option in setup)

Quote
<?xml version = "1.0" encoding = "utf-8"?>
<altbinz>
  <title>alt.binz status</title>
  <description>Stats from alt.binz</description>
  <limit>No limit</limit>
  <CurrentSpeed>0 KB/s</CurrentSpeed>
  <QueueSize>0.00 MB</QueueSize>
  <ETA>Unknown</ETA>
  <FreeSpace> Free: 82.95 GB</FreeSpace>
  <connect>false</connect>
</altbinz>


-on server startup - again script, but this time force altbinz to connect

Quote
<?xml version = "1.0" encoding = "utf-8"?>
<altbinz>
  <title>alt.binz status</title>
  <description>Stats from alt.binz</description>
  <limit>No limit</limit>
  <CurrentSpeed>0 KB/s</CurrentSpeed>
  <QueueSize>0.00 MB</QueueSize>
  <ETA>Unknown</ETA>
  <FreeSpace> Free: 82.95 GB</FreeSpace>
  <connect>true</connect>
</altbinz>

Offline Hecks

  • Contributor
  • ***
  • Posts: 2011
  • naughty cop
Re: pause downloads if download folder disspears
« Reply #2 on: January 31, 2012, 08:02:06 pm »
Powershell script incoming!

Code: [Select]
function Connect-Altbinz
{
write ((Log-DateTime) + " Connecting Altbinz ................")
$abstatusxml = "C:\Altbinz\altbinz_status.xml"
$abstatus = {[xml] (get-content $abstatusxml)}
if ($abstatus.altbinz.connect -imatch "false")
{
$abstatus.altbinz.connect = "true"
$abstatus.save($abstatusxml)
}
}

function Disconnect-Altbinz
{
write ((Log-DateTime) + " Disconnecting Altbinz .............")
$abstatusxml = "C:\Altbinz\altbinz_status.xml"
$abstatus = {[xml] (get-content $abstatusxml)}
$abstatus.altbinz.connect = "false"
$abstatus.save($abstatusxml)
}

function Log-DateTime
{
get-date -format "dd/MM/yyyy HH:mm:ss"
}

## Run it
Disconnect-Altbinz
sleep 30 # or whatevs
Connect-Altbinz


You know you love 'em. :P
« Last Edit: January 31, 2012, 08:10:16 pm by Hecks »

Offline teenhype90210

  • Contributor
  • ***
  • Posts: 7
Re: pause downloads if download folder disspears
« Reply #3 on: February 01, 2012, 02:44:26 am »
how about if the router reboots but server doesn't reboot - my router also reboots every day, but at software determined timing which varies and causes the same problem.

Offline Rdl

  • Administrator
  • *****
  • Posts: 4050
Re: pause downloads if download folder disspears
« Reply #4 on: February 01, 2012, 08:47:48 am »
I'm not sure how router fits in this story? Unless it's used as network switch between computer and server?

Offline teenhype90210

  • Contributor
  • ***
  • Posts: 7
Re: pause downloads if download folder disspears
« Reply #5 on: February 01, 2012, 09:10:58 pm »
My computers are all plugged into the same network router.  One is a server, and all the other computers have mapped locations for saving to the server.  One of the computers has Alt Binz running on it and is downloading to the mapped server location.  For me this is more efficient (downloading straight to server) than constantly downloading locally and then transferring everything to the server afterwords (since server has all the storage).  If the router crashes, reboots, unplugges, etc. for whatever reason, this causes the same problem with Alt Binz defaulting back to a different folder.  Would be nice to have an options to disable or pause downloads in this event instead of just triggering a message that the download folder was changed.

Offline Rdl

  • Administrator
  • *****
  • Posts: 4050
Re: pause downloads if download folder disspears
« Reply #6 on: February 01, 2012, 09:22:07 pm »
$5 switch would resolve that problem :)

I'll see what I can do about it (btw, did you try setting one general category for all downloads and setting same folder as default download folder?)