Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GNU tar Usage

Status
Not open for further replies.

Michael42

Programmer
Oct 8, 2001
1,454
US
Hello, I am using GNU tar 1.13 as shown below. How can I backup the files in the local system's root (/) directory?

When I specify / it grabs ALL mountpoints (nfs automounts too) [3eyes].

Thanks! :)


/cots/tar1.13/tar cvpM -C / -f sunsrv3:/dev/rmt/1 -b 126 usr opt tmp usr1


 
You can use find / -xdev > /tmp/filelist followed by tar cf filename.tar -I /tmp/filelist.

-xdev (a.k.a. -mount) prevents find from traversing other filesystems. Annihilannic.
 
Annihilannic,

Very nice - this works fine.

Thanks! :)
 
If I could ask you assitance on a tweak please...

I need to remove the "/" entry from the list created by my find command (find / -mount > /tmp/filelist). This entry is causing problems.

How can I yank the line that contains just the entry /

Thanks again :) ,

Michael42
 
find / -xdev | grep -v '^/$' > /tmp/filelist

I'd also make it relative directories:
cd /; find . -xdev | grep -v '^./$ > /tmp/filelist

 
Wonboodoo,

This fixed it!

Thanks for the suggestion.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top