Re: tar exclude command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Hello,
>
> tar -cv --exclude '/var/named/chroot/proc/*' -zf backup.tar.gz /var/named
>   
I think this is the best way to use wildcards in expressions to avoid 
problems. ;)
>
>
> tar -cv --exclude /var/named/chroot/proc -zf backup.tar.gz /var/named
>   
Yes, it works, but it didn't create the proc folder inside the tar 
folder tree. Example:

Original folder tree:

- var
    |- named
       |- chroot
          |- proc
             |- garbage1.txt
             |- garbage2.txt
          |- foo
             |- test1.txt
             |- test2.txt
          |- bar
             |- test3.txt
             |- test4.txt

# tar -cv --exclude '/var/named/chroot/proc/*' -zf backup.tar.gz /var/named


Will keep this structure at backup.tar.gz

- var
    |- named
       |- chroot
          |- proc
          |- foo
             |- test1.txt
             |- test2.txt
          |- bar
             |- test3.txt
             |- test4.txt

tar -cv --exclude /var/named/chroot/proc -zf backup.tar.gz /var/named

Will save this structure at backup.tar.gz

- var
    |- named
       |- chroot
          |- foo
             |- test1.txt
             |- test2.txt
          |- bar
             |- test3.txt
             |- test4.txt

[]s


-- 
Fábio da Silva Júnior - fjuniorlista@xxxxxxxxx
----- http://fabioojunior.wordpress.com -----

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux