1

I can't work out why my exclude isn't working:

tar --exclude=/{dev,proc,tmp,mnt,backup} -I pigz -cf backup.gz *

Gives me:

root@ca1:/# tar --exclude=/{dev,proc,tmp,mnt,backup} -I pigz -cf backup.gz *

tar: backup.gz: file changed as we read it
tar: proc/irq/11/smp_affinity: file changed as we read it
tar: proc/irq/26/smp_affinity: file changed as we read it
tar: proc/sys/net/ipv4/route/flush: Cannot open: Permission denied
tar: proc/sys/net/ipv6/route/flush: Cannot open: Permission denied
tar: proc/sys/vm/compact_memory: Cannot open: Permission denied
tar: proc/sys/vm/drop_caches: Cannot open: Permission denied

I'm guessing my syntax isn't quite right (I've tried it as separate --exclude statements, quoted, relative vs absolute etc)

1 Answer 1

0

Typical - just found the way to do it:

tar -v --exclude='proc/*' \
    --exclude='dev/*' \
    --exclude='tmp/*' \
    --exclude='mnt/*' \
    --exclude='backup/*' \
    --exclude='sys/*' \
    --exclude='run/*' \
    --exclude='boot/*' \
    --exclude='backup.gz' \
-I pigz -cf backup.gz *

You must log in to answer this question.

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