02-20-2009
Hi,
cd /destinationfolder && pax -r < files.tar
has one inconvenient:
it does a cd to destinationfolder.
I want to stay where the script was executed.
thanks
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi all,
kindly help me how to extract one file form .tar.gz without uncompressing .tar.gz file.
thanks in advance
bali (2 Replies)
Discussion started by: balireddy_77
2 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I want to extract myfile.war to a folder which is in the same folder with war file.I did this as normal:
jar -xvf myfile.war
But it exploded all the content of file to the same level folder instead of that I was expecting to create a folder called myfile.
This works with tar:
... (0 Replies)
Discussion started by: reis3k
0 Replies
3. Linux
Hi,
how can I extract glibc-2.3.2.tar.tar file ?
I used tar -xf but does not work.
Thank you. (4 Replies)
Discussion started by: big123456
4 Replies
4. Shell Programming and Scripting
hye there...
i have a problem to copy file in specific folder
that will change the name according to
host,time(%m%s) and date(%Y%M%D)
example folder name:
host_20100531.154101801
this folder name will always change...
but i just want to copy the AAA.txt and BBB.txt file..
really need... (17 Replies)
Discussion started by: annetote
17 Replies
5. Emergency UNIX and Linux Support
Hi All-
I want to extract a particular folder from .tar format files.
For example:
File Name: backup.tar
The backup.tar contains the below folders & files.
1) /root_folder/Folder1/Folder1-1/*
2) /root_folder/Folder1/Folder1-2/*
3) /root_folder/Folder2/Folder2-1/*
4)... (5 Replies)
Discussion started by: k_manimuthu
5 Replies
6. UNIX for Dummies Questions & Answers
How do I create individual tars of a all the directories in a directory? I have a directory called 'patients', each patient has a directory in the patients directory. I want to create tars such that each patient has their own tar file.
Thanks! (5 Replies)
Discussion started by: HappyPhysicist
5 Replies
7. Shell Programming and Scripting
Hi all,
I have created a function that looks for a folder in a particular directory, checks the date it was last modified and if its old then compress it.
This works fine for files using gzip. However for folders I had to use tar. This is my function:
compressOldFolder()
{
# $1 is... (10 Replies)
Discussion started by: TasosARISFC
10 Replies
8. UNIX for Dummies Questions & Answers
I would like to confirm my file.tar is been tar-ed correctly before I remove them. But I have very limited disc space to untar it.
Can I just do the listing instead of actual extract it? Can I say confirm folder integrity if the listing is sucessful without problem?
tar tvf file1.tar
... (1 Reply)
Discussion started by: vivien_chu
1 Replies
9. Solaris
Hi all,
In Solaris howto extract tar file to specific folder.
This is what we do in Linux, but how to do the same thing in Solaris ?
-tar -xzvf /tmp/etc.tar.bz -C /tmp
(Will extract in /tmp dir)
3.gzip COMPRESSION AND EXTRACTION
-tar -czvf /tmp/etc.tar.bz /etc
-du ... (5 Replies)
Discussion started by: manalisharmabe
5 Replies
10. Shell Programming and Scripting
I need help to write shell script to copy files from one server to another server.
Source Directory UAE(inside i have another folder Misc with files inside UAE folder).I have to copy this to another server UAE folder( Files should be copied to UAE folder and Misc files should be copied in target... (3 Replies)
Discussion started by: naresh2389
3 Replies
LEARN ABOUT MOJAVE
sendfiles
SENDFILES(1) [nmh-1.5] SENDFILES(1)
NAME
sendfiles - send multiple files via a MIME message
SYNOPSIS
sendfiles [delay] mailpath subject file1 [file2 ...]
DESCRIPTION
The shell script sendfiles, is used to send a collection of files and directories via electronic mail.
sendfiles mailpath "subject" files ...
sendfiles will archive the files and directories you name with the tar command, and then mail the compressed archive to the "mailpath" with
the given "subject". The archive will be automatically split up into as many messages as necessary in order to get past most mailers.
Sometimes you want sendfiles to pause after posting a partial message. This is usually the case when you are running sendmail and expect
to generate a lot of partial messages. If the first argument given to sendfiles starts with a dash, then it is interpreted as the number
of seconds to pause in between postings, e.g.,
sendfiles -30 mailpath "subject" files ...
will pause 30 seconds in between each posting.
Extracting the Received Files
When these messages are received, invoke mhstore once for the list of messages. The default is for mhstore to store the combined parts as
a new message in the current folder, although this can be changed using storage formatting strings. You can then use mhlist to find out
what's inside; possibly followed by mhstore again to write the archive to a file where you can subsequently uncompress and untar it. For
instance:
% mhlist 5-8
msg part type/subtype size description
5 message/partial 47K part 1 of 4
6 message/partial 47K part 2 of 4
7 message/partial 47K part 3 of 4
8 message/partial 18K part 4 of 4
% mhstore 5-8
reassembling partials 5,6,7,8 to folder inbox as message 9
% mhlist -verbose 9
msg part type/subtype size description
9 application/octet-stream 118K
(extract with uncompress | tar xvpf -)
type=tar
conversions=compress
% mhstore 9
% uncompress < 9.tar.Z | tar xvpf -
Alternately, by using the -auto switch, mhstore will automatically do the extraction for you:
% mhlist 5-8
msg part type/subtype size description
5 message/partial 47K part 1 of 4
6 message/partial 47K part 2 of 4
7 message/partial 47K part 3 of 4
8 message/partial 18K part 4 of 4
% mhstore 5-8
reassembling partials 5,6,7,8 to folder inbox as message 9
% mhlist -verbose 9
msg part type/subtype size description
9 application/octet-stream 118K
(extract with uncompress | tar xvpf -)
type=tar
conversions=compress
% mhstore -auto 9
-- tar listing appears here as files are extracted
As the second tar listing is generated, the files are extracted. A prudent user will never put -auto in the .mh_profile file. The correct
procedure is to first use mhlist to find out what will be extracted. Then mhstore can be invoked with -auto to perform the extraction.
FILES
$HOME/.mh_profile The user profile
PROFILE COMPONENTS
Path: To determine the user's nmh directory
Current-Folder: To find the default current folder
SEE ALSO
mhbuild(1), mhlist(1), mhshow(1), mhstore(1). Proposed Standard for Message Encapsulation (RFC-934)
DEFAULTS
`-noverbose'
CONTEXT
None
MH.6.8 11 June 2012 SENDFILES(1)