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?
--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 ...
./sys
,/proc
, and/dev
.