Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Dec 2018 09:28:58 +0100
From:      Polytropon <freebsd@edvax.de>
To:        Matthias Petermann <matthias@petermann-it.de>
Cc:        freebsd-questions <freebsd-questions@freebsd.org>
Subject:   Re: /sbin/dump: instant exit in case of disk full (instead of prompting for next volume)
Message-ID:  <20181207092858.101f83be.freebsd@edvax.de>
In-Reply-To: <6116a4e5-34d1-3823-dd5e-28c784083cf2@petermann-it.de>
References:  <6116a4e5-34d1-3823-dd5e-28c784083cf2@petermann-it.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 7 Dec 2018 08:35:10 +0100, Matthias Petermann wrote:
> I am using dump(8) to backup local filesystems to an USB drive. Is there 
> an easy way to non-interactively exit dump in case of target disk full 
> error?

According to "man dump", this is a situation where operator
interaction is explicitely required:

     The dump utility requires operator intervention on these conditions: end
     of tape, end of dump, tape write error, tape open error or disk read
     error (if there are more than a threshold of 32).  In addition to alert-
     ing all operators implied by the -n key, dump interacts with the operator
     on dump's control terminal at times when dump can no longer proceed, or
     if something is grossly wrong.  All questions dump poses must be answered
     by typing ``yes'' or ``no'', appropriately.

This is consistent with your description.

However, you could modify the dump program to exit with a
specific error code if "disk is full" should be reached.



> One way I explored was by using expect (script below), but I rather 
> would use exclusively tools from base and don't want to add extra 
> complexity to my backup script.

It seems that using "expect" is a good solution here, as
the "dump" program does not natively support what you want.



> In case there is no easy way currently, would it make sense to enhance 
> dump to provide an option for non interactive mode?

That is a legitimate request, and a feature most welcome. ;-)



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20181207092858.101f83be.freebsd>