07-21-2008
Extracting certain /paths/* using tar
forgive my ignorance.
I did a search of this sub-forum for "tar -xp" and variations on the same w\out success, so here goes...
Scenario:
filename.tar file.
Desired Task:
I want to be able to extract only files from the user's public_html folder (and all those under it as an option) from the archive.
Usual target path:
/home/$user/public_html/*
(the archive is on a nas, so extracting to the current directory where the archive lives will have to do, for now).
What I've tried:
tar --extract --file=-filename.tar $user (I think this worked, but I was i a hurry and at the end of a long day)
What I've read to try:
tar -xp <something> (haven't had the chance to try anything along these lines)
Thank you for your time and assistance.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi folks,
When I am extracting an archive using the:
tar -xvf /dev/rmt0 command i get the following error:
x ./GRBD8901/GRBR006T, 1763253368 bytes, 3443855 media blocks.
tar: 0511-197 ./GRBD8901/GRBR006T: Cannot write data extracted with the tar command: ... (7 Replies)
Discussion started by: Erik Rooijmans
7 Replies
2. UNIX for Advanced & Expert Users
hi
could any body tell me how to extract .tar.bz2 files
i tried using tar but in vain.
i found bzip2 in googling but i could not find it on machine unix tru64
please suggest. (1 Reply)
Discussion started by: Raom
1 Replies
3. UNIX for Dummies Questions & Answers
Dear experts
I have received a tar file containing several files with full path. Now I need to restore it in another system but when I want to extract files by using
tar -xvf tarfile
it wants to create all files with full paths again in new system in which I don't have enough previleges.
How... (4 Replies)
Discussion started by: Reza Nazarian
4 Replies
4. UNIX Desktop Questions & Answers
Can I extract files from an archive file (tar), where the filename includes the full directory path, to a different directory?
For example the archive files may have a filename of
/SrcFiles/XXX/filename.dat
and I want to extract it to /SrcFiles/YYY/filename.dat. Since the archive file... (1 Reply)
Discussion started by: nmalencia
1 Replies
5. Shell Programming and Scripting
Hi,
I have a file paths.txt with all the file paths. I want to tar everything in those paths to a file.
for example paths.txt contains
/data/extention
/logs/extension
/code/extenstion
Now I want to tar using command
tar cvf extention.tar path1 path2
where
path1 -> /data/extention... (2 Replies)
Discussion started by: muaz
2 Replies
6. Shell Programming and Scripting
There is a file paths.txt with paths containing data for example
E:/<BUILD_NAME>/data/common
E:/<BUILD_NAME>/log/common
E:/<BUILD_NAME>/temp/common
E:/<BUILD_NAME>/code/common
While reading this file I want to replace the <BUILD_NAME> from a variable $BUILD in the following command:
tar... (1 Reply)
Discussion started by: muaz
1 Replies
7. Shell Programming and Scripting
Hey guys complete n00b here so I'll try my best at explaining.
I'm creating a backup and restore utility and decided to use tar. I create a backup folder in each user's account and when backing up (say word processing files), I use the following:
tar cvf /home/user/backup/wpbackup.tar... (2 Replies)
Discussion started by: EwanD
2 Replies
8. Shell Programming and Scripting
HOw can I create a tar file with relative paths
find . -depth -print | xargs tar -cvf /tmp/file.tar ?
Thanks to all who answer (1 Reply)
Discussion started by: BeefStu
1 Replies
9. Solaris
Hi,
How do I extract data from TAR excluding absolute paths for Tar? (Solaris)
Thanks (3 Replies)
Discussion started by: zam
3 Replies
10. UNIX for Dummies Questions & Answers
I am trying to extract tar file of size 167MB but most of the times tar command stuck while extraction.
Command:
new 24389 24369 0 Nov21 ? 00:00:00 tar -xf NCSanJose1_req_rep.tar
While running process with gdb following back trace was obtain:
... (24 Replies)
Discussion started by: freebee
24 Replies
LEARN ABOUT CENTOS
shape_tar
SHAPE_TAR(1) General Commands Manual SHAPE_TAR(1)
NAME
shape_tar - shapeTools RMS bundle up subsystem in a tar or shar archive
SYNOPSIS
shape tar[VERSIONS=<version_selection_rule>] [ARCHIVE=<filename>]
shape shar[VERSIONS=<version_selection_rule>] [ARCHIVE=<filename>]
DESCRIPTION
Shape tar and shape shar create a tar or a shar archive containing all source components of the current node in the system tree. All source
components listed in the COMPONENTS macro in the Makefile and the release identification file (VERSIONFILE) are written to the archive.
Components of subsystems are not included in the archive file.
The VERSIONS macro may be set to specify a version selection rule to be active during archive file creation. Default is most_recent,
selecting the most recent version of each component. See shape_stdrul(7) or the $(SHAPELIBPATH)/stdrules for other possible settings. You
may also use self defined version selection rules as VERSIONS.
ARCHIVE is the base name of the file where the output shall be written to. Default is $(SUBSYSTEMNAME). The output file gets the filename
extension .tar (resp. .shar). When ARCHIVE=- is given, data will be written to standard output.
SEE ALSO
shape_RMS(1), shape_stdrul(7)
FILES
$(SUBSYSTEMNAME).tar $(SUBSYSTEMNAME).shar
7.8.119 SHAPE_TAR(1)