/sbin/dump: instant exit in case of disk full (instead of prompting for next volume)
freebsd at edvax.de
Fri Dec 7 08:29:08 UTC 2018
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
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. ;-)
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
More information about the freebsd-questions