03-10-2009
tar, zip multiple separate directories and move the results to another volume
TIA,
I'm using FreeBSD 6
I have a series of Directories (A,B,C,...Z). Each directory has files and other directories within it.
I want to compress the contents of each top directory into a single file so that I get an archive of each directory (for example, A.gzip) AND and want to move that compressed file to another volume on the system.
I have managed to be able to gzip the contents of each directory, but end up with a complete directory structure full of .gzips.
Looking on here I see that tar appears to be able to create the single-file archives I want, but I cannot tell if tar will compress and combine the files AND put the finished results on the other volume.
Ideas? Thanks again,
johnC
10 More Discussions You Might Find Interesting
1. BSD
Hello,
I have a little problem with backup & restoring files from tape drive.
I am adding 3 directories to my tape, and it is OK:
hades# tar -cvf /dev/nsa0 test test1 restore
a test
a test/level1
a test/myharddisk.img
a test1
a test1/level1
a test1/myharddisk.img
a test1/test.img
a... (1 Reply)
Discussion started by: d3m00n
1 Replies
2. Shell Programming and Scripting
I have a list of postal addresses and I need to pull the records that match a list of zip codes in a separate file. The postal addresses are fixed width. The zip code is located in character position 149-157.
Something better than: cat postalfile.txt | grep -f zipcodes.txt
would be great.
$... (8 Replies)
Discussion started by: sitney
8 Replies
3. AIX
I have to zip many pdf files and the size of zip file must not exceed 200 MB. When size is more than 200 MB then multiple zip files needs to be created.
How we can achieve this in UNIX?
I have tried ZIP utility but it takes a lot of time when we add individual pdfs by looping through a... (1 Reply)
Discussion started by: tom007
1 Replies
4. Shell Programming and Scripting
Hi all,
I have a tar file and inside that tar file is a folder with additional tar.gz files. What I want to do is look inside the first tar file and then find the second tar file I'm looking for, look inside that tar.gz file to find a certain directory. I'm encountering issues by trying to... (1 Reply)
Discussion started by: bashnewbee
1 Replies
5. Shell Programming and Scripting
Hi
I have a requirement in unix shell where I need to zip multiple files on server to one single .zip file. I dont see zip command in AIX and gzip command not doing completely what I want.
One I do .zip file, I should be able to unzip in my local Computer.
Here is example what I want... (9 Replies)
Discussion started by: RAMA PULI
9 Replies
6. UNIX for Dummies Questions & Answers
I have figured out how to create a tar file that holds all the files in a particular directory. The plan is to move the tar to a new system via FTP so that we can test the new system with our files and libraries. What I can't figure out is how to unzip the tar file; I keep getting messages that... (8 Replies)
Discussion started by: KathyB148
8 Replies
7. Shell Programming and Scripting
#cat a
BAC064DAL
BAC063DAL
BAC056PHX
BAC066DAL
BAC062PHX
BAC062DAL
BAC060DAL
BAC058PHX
BAC054PHX
BAC051PHX
# for i in `cat a`
> do
> tar xvf $a/$a*.tar*
> done
tar: /*.tar*: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
tar: /*.tar*: Cannot... (3 Replies)
Discussion started by: kenshinhimura
3 Replies
8. Shell Programming and Scripting
i extract it through script, is there any way to script or automate to tar extract a tarfiles in multiple directories at once?
Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
for dir in `ls -d /tarfiles/*/ | sed 's/.$//'`
do
rm -f $dir/*.tar
mv -f... (1 Reply)
Discussion started by: kenshinhimura
1 Replies
9. UNIX for Beginners Questions & Answers
Hi all i am very new to shell scripting and need some help from you to learn
1)i have some log files that gets generated on daily basis example: i have abc_2017_01_30_1.log ,2017_01_30_2.log like wise so i want to zip this 4 logs which are created on same date into one zip folder.
2)Post zipping... (2 Replies)
Discussion started by: b.saipriyanka
2 Replies
10. Shell Programming and Scripting
Hi all i am very new to shell scripting and need some help from you to learn
1)i have some log files that gets generated on daily basis example: i have abc_2017_01_30_1.log ,2017_01_30_2.log like wise so i want to zip this 4 logs which are created on same date into one zip folder.
2)Post zipping... (1 Reply)
Discussion started by: b.saipriyanka
1 Replies
DTRX(1) DTRX(1)
NAME
dtrx - cleanly extract many archive types
SYNOPSIS
dtrx [OPTIONS] ARCHIVE [ARCHIVE ...]
DESCRIPTION
dtrx extracts archives in a number of different formats; it currently supports tar, zip (including self-extracting .exe files), cpio, rpm,
deb, gem, 7z, cab, rar, and InstallShield files. It can also decompress files compressed with gzip, bzip2, lzma, or compress.
In addition to providing one command to handle many different archive types, dtrx also aids the user by extracting contents consistently.
By default, everything will be written to a dedicated directory that's named after the archive. dtrx will also change the permissions to
ensure that the owner can read and write all those files.
To run dtrx, simply call it with the archive(s) you wish to extract as arguments. For example:
$ dtrx coreutils-5.*.tar.gz
OPTIONS
dtrx supports a number of options to mandate specific behavior:
-r, --recursive
With this option, dtrx will search inside the archives you specify to see if any of the contents are themselves archives, and
extract those as well.
--one, --one-entry
Normally, if an archive only contains one file or directory with a name that doesn't match the archive's, dtrx will ask you how to
handle it. With this option, you can specify ahead of time what should happen. Possible values are:
inside Extract the file/directory inside another directory named after the archive. This is the default.
rename Extract the file/directory in the current directory, and then rename it to match the name of the archive.
here Extract the file/directory in the current directory.
-o, --overwrite
Normally, dtrx will avoid extracting into a directory that already exists, and instead try to find an alternative name to use. If
this option is listed, dtrx will use the default directory name no matter what.
-f, --flat
Extract all archive contents into the current directory, instead of their own dedicated directory. This is handy if you have multi-
ple archive files which all need to be extracted into the same directory structure. Note that existing files may be overwritten
with this option.
-n, --noninteractive
dtrx will normally ask the user how to handle certain corner cases, such as how to handle an archive that only contains one file.
This option suppresses those questions; dtrx will instead use sane, conservative defaults.
-l, -t, --list, --table
Don't extract the archives; just list their contents on standard output.
-m, --metadata
Extract the metadata from .deb and .gem archives, instead of their normal contents.
-q, --quiet
Suppress warning messages. Listing this option twice will cause dtrx to be silent.
-v, --verbose
Show the files that are being extracted. Listing this option twice will cause dtrx to print debugging information.
--help Display basic help.
--version
Display dtrx's version, copyright, and license information.
AUTHOR
Brett Smith <brettcsmith@brettcsmith.org>
COPYRIGHT
dtrx 6.5 is copyright (C) 2006-2009 Brett Smith and others. Feel free to send comments, bug reports, patches, and so on. You can find the
latest version of dtrx on its home page at <http://www.brettcsmith.org/2007/dtrx/>.
dtrx is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER-
CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
6.5 2009-07-04 DTRX(1)