Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 4 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

Your Answer


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.