0

I want to backup my root dir with Tar but getting this error:

beende mit fehlerstatus aufgrund vorheriger fehler

In English:

Exiting with failure status due to previous errors

Here is my code:

#!/bin/bash
DATE=$(date +%Y-%m-%d-%H%M%S)
BACKUP_DIR="/mnt/disk/public/Backup"
SOURCE="/"
EXCLUDE="--exclude=/mnt/disk/public"
tar -vzcpf $BACKUP_DIR/backup-$DATE.tar.gz $SOURCE $EXCLUDE

What is the error here?

  • 2
    Your --exclude option might be being ignored (and parsed as a path) because it follows the source. You should move it to before the other options, i.e. tar $EXCLUDE -vzcpf .... – Flup Oct 4 '16 at 12:50
  • I have it with tar EXCLUDE... but no change. But I get the same error! – fteinz Oct 4 '16 at 14:13
  • 5
    What other error messages is tar displaying? You may need to exclude some pseudo-filesystems such as /sys, /proc, and /dev. – Mark Plotnick Oct 4 '16 at 16:16
  • The answer depends on what the full output on stdout and stderr is. – Alexander Jul 11 '17 at 14:45
0

The error means that tar is unable to add some files to the tarball.

In fact you are backing up everything from / which is certain to result to an error.

Try to replace the EXCLUDE variable with this:

EXCLUDE="--exclude=dev --exclude=mnt --exclude=proc --exclude=run --exclude=sys --exclude=tmp"

and omit the -v flag so you can reduce the amount of output messages and pinpoint the error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.