Subject: Re: Feature proposal - over-quota script execution
From: Ondřej Jirman
Date: Mon, 22 Jun 2020 00:48:09 +0200
On Sun, Jun 21, 2020 at 04:45:42PM +0000, analoq wrote:
> That does sound cleaner given that the implementation is due to the program
> structure and my limited knowledge of it not exactly perfect.
> 
> Are these exit codes already implemented, and how does one restart the
> download after megatools was 'over quota' terminated? Simply restarting
> a download after 'ctrl+c' terminating it causes the download to start from
> zero.
> 

There was some test patch I sent to someone, but the person didn't do much
testing:

  https://megous.com/dl/tmp/p.patch

Download should resume if possible. Progress indicator always starts from 0%.

regards,
	o.

> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> On Sunday, June 21, 2020 6:30 PM, Ondřej Jirman <megatools@megous.com> wrote:
> 
> > Hi,
> >
> > On Sun, Jun 21, 2020 at 04:01:54PM +0000, analoq wrote:
> >
> > > Hi,
> > > Is there interest in a feature that allows the user to specify a script that
> > > gets executed whenever an 'Over quota' error is encountered? I am using this
> > > for a while now and it is quite handy.
> > > The way my implementation currently works is: megatools dl --exec-on-quota
> > > "path/to/script.sh" ....
> > > https://gitlab.com/analoq/megatools
> >
> > I think it's more usual for programs to return different statuses per error
> > type, and this allows scripts to use the exit status in conditional code.
> >
> > regards,
> > o.
> 
>