Menu

#6 When restoring on a client machine, warn if potential ENOSPC

open
nobody
None
2011-05-19
2011-05-18
Anonymous
No

Originally created by: fge

When using, for instance, amfetchdump, to restore from a backup into an arbitrary location, warn/bailout if restoring to the selected device will lead to ENOSPC.

For instance, on IRC, a case has been reported of "gzip exited with return code 1". After some quick investigation from the affected user, it appeared that ENOSPC was the cause. The fact that gzip exited with that particular exit code was unhelpful: the real cause was not found.

While each and every cause cannot be analyzed, I think it is at least possible, before starting to restore a backup to an arbitrary location, to warn the user, if he restores interactively, that restoring this backup to this location can potentially read to ENOSPC, given that:
- the client can know what space is left on the device, and
- the server can know what size is to be written to that device should the restore be ordered.

Yes, there are many corner cases, but a first, not-so-precise implementation can imho be easily achieved.

Discussion

  • Anonymous

    Anonymous - 2011-05-18

    Originally posted by: djmitche

    I like this. It's tricky with the common case of amfetchdump's output going to stdout, but when it's writing to a file, it's easy enough.

     
  • Anonymous

    Anonymous - 2011-05-19

    Originally posted by: martineau

    I like it too, it can also be done in amrestore.
    Check for -C -c or -l arguments of amfetchdump.
    Check for -r argument of amrestore.

     

Log in to post a comment.