1833299 Members
2783 Online
110051 Solutions
New Discussion

Re: Backup CPIO or TAR

 
SOLVED
Go to solution
Bob Fraser
Occasional Advisor

Backup CPIO or TAR


I want to backup a directory using a
command such as;

tar -cvf - .|/usr/contrib/bin/gzip - >/BU_Drive/APPS/APPS_backup.tar.gz

The problem I am having is that I have NFS mounts underneath I do not want to include.

I cannot find an option for tar not to include a nfs mounts like cpio -xdev

Any suggestions?
6 REPLIES 6
Muthukumar_5
Honored Contributor

Re: Backup CPIO or TAR

You can use find -xdev and direct files to tar operation.

hth.
Easy to suggest when don't know about the problem!
Muthukumar_5
Honored Contributor
Solution

Re: Backup CPIO or TAR

Try as,

cd /; find . -xdev | xargs tar -cvf - | gzip - > /BU_Drive/APPS/APPS_backup.tar.gz

hth.
Easy to suggest when don't know about the problem!
Hakan Aribas
Valued Contributor

Re: Backup CPIO or TAR

For example:
tar cvfX backup.tar NFSmounts.txt /export/home

NFSmounts.txt --> The files in this text file will not be added backup.tar

Arunvijai_4
Honored Contributor

Re: Backup CPIO or TAR

Hi,

You can use -xdev with find to skip all the NFS file systms.

find . -xdev | xargs tar -cvf - | gzip - | /BU_Drive/APPS/APPS_backup.tar.gz

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Muthukumar_5
Honored Contributor

Re: Backup CPIO or TAR

Hakan,

X (Exclude) option is not available in hp-ux tar (I think). I hope you have tested in Linux?

hth.
Easy to suggest when don't know about the problem!
Bob Fraser
Occasional Advisor

Re: Backup CPIO or TAR

The last comment was perfect!