Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am trying to backup my Ubuntu workstation by the help of this guide and are running into trouble as the tar command outputs

Exiting with failure status due to previous errors.

Here's what I ran in terminal:

sudo -i
cd /
tar -cvpzf sysbackup-20110821.tar.gz \
    --exclude=/sysbackup-20110821.tar.gz \
    --exclude=/proc \
    --exclude=/lost+found \
    --exclude=/sys \
    --exclude=/mnt \
    --exclude=/media \
    --exclude=/dev /

So from searching a bit, the error seems to be of a non-critical nature, but as I checkout the contents of the actual .tar file, my /home-folder is missing, so obviously something went clearly wrong.

What should I do instead to backup my system without errors?

share|improve this question
    
tar should show what the error is: remove v-verbose flag or send all output to /dev/null. You should see more clearly the error messages. Alternatively, send stderr to a file, then show us what is in. –  enzotib Aug 21 '11 at 20:17
    
Also, is the home encrypted? Is accessible from root user? –  enzotib Aug 21 '11 at 20:58
    
/home is not encrypted. It did appear in the rar-file though when I re-ran the command, altough the "exting with failure..." keeps appearing –  Industrial Aug 21 '11 at 21:11
    
It could depend on the absolute path, that distrubs tar, try substituting . to / –  enzotib Aug 21 '11 at 21:16
    
Hi Entzotib. Sorry for the confusion - replace / with /? –  Industrial Aug 22 '11 at 6:54
show 2 more comments

1 Answer

up vote 1 down vote accepted

I suggest a command line as the following:

tar -cvpzf sysbackup-20110821.tar.gz --one-file-system \
    --exclude=/sysbackup-20110821.tar.gz \
    --exclude=./run \
    --exclude=./tmp \
    --exclude='./home/*/.gvfs' ./

As you see, every exclude pattern becomes a relative path, and the --one-file-system option excludes /dev, /proc, /sys, and everything mounted under /media or /mnt.

Nevertheless, if you have a separate home partition, this is not backed up.

Tested on 11.10 (Oneiric, alpha3). Probably, in previous ubuntu versions you should exclude ./var/run, instead of /run.

share|improve this answer
    
Thanks enzotib! That did it! –  Industrial Aug 22 '11 at 18:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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