Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Dec 2018 09:28:58 +0100
From:      Polytropon <>
To:        Matthias Petermann <>
Cc:        freebsd-questions <>
Subject:   Re: /sbin/dump: instant exit in case of disk full (instead of prompting for next volume)
Message-ID:  <>
In-Reply-To: <>
References:  <>

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. ;-)

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

Want to link to this message? Use this URL: <>