1

I want to make a backup, but my tapes don't have space for everything, so I decided to not back up virtual machines (over 1tb).

I have the virtual machines in .local/share/libvirt/images

I used this command

tar cvf - /home/user -X altro/file.esclude  | openssl aes-256-cbc -salt  -k "password" | dd bs=80M of=/dev/st0

In altro/file.esclude I put this line /home/user/.local/share/libvirt/images

But tar ignore the exclude file and backups everything!!

So I use

tar cvf - /home/user --exclude '/home/user/.local/share/libvirt/images'  | openssl aes-256-cbc -salt  -k "password" | dd bs=80M of=/dev/st0

And... same thing!

Why?


System is Slackware 14.2 with gnu tar

3
  • Does it work if you remove /home/user/? (See also a related question in askubuntu.)
    – njsg
    Apr 11, 2017 at 16:33
  • Also, I believe the syntax is --exclude='pattern' (an equal sign, not a space). And, just in case, provide some information about which version of tar is this. GNU?
    – njsg
    Apr 11, 2017 at 16:35
  • yes gnu tar on linux,i add now
    – elbarna
    Apr 11, 2017 at 16:46

1 Answer 1

1

The X must be before the paths to include in the tar file.

So:

tar cvf - /home/user -X altro/file.esclude  | openssl aes-256-cbc -salt  -k "password" | dd bs=80M of=/dev/st0

is WRONG.

This:

tar cvf - -X /home/user/altro/file.esclude /home/user | openssl aes-256-cbc -salt  -k "pass" | dd bs=80M of=/dev/st0

is RIGHT

In the exclude file, I use

/home/user/.local/share/libvirt/images/*

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .