04-28-2008
Create individual tgz files from a set of files
Hello
I have a ton of files in a directory of the format app.log.2008-04-04
I'd like to run a command that would archive each of these files as app.log.2008-04-04.tgz
I tried a few combinations of find with xargs etc but no luck.
Thanks
Amit
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
hi all
How to unzip .tgz files
waiting for suggestions
Praful (5 Replies)
Discussion started by: Prafulla
5 Replies
2. UNIX for Dummies Questions & Answers
Let's say I've got File.tgz that contains:-
Apple.txt
Banana.txt
Carrot.txt
AppleBanana.txt
Now, I would like to only extract files that contain the patter "Apple".
I've tried this
tar -xvf File.tgz 'tar -tf File.tgz | grep 'Apple''
but it does not work. Please help. Thanks. (12 Replies)
Discussion started by: percivalwcy
12 Replies
3. Shell Programming and Scripting
Hi All,
I am using the awk command to replace ',' by '\t' (tabs) in a csv file. I would like to apply this to all .csv files in a directory and create .txt files with the tabs.
How would I do this in a script?
I have the following script called "csvtabs":
awk 'BEGIN {
FS... (4 Replies)
Discussion started by: ScKaSx
4 Replies
4. Shell Programming and Scripting
Hi,
I have already created the tar files. which consist of some log files and Audit.csv
plz see the below code for that
================================================
tar -Pczf ARCH/${arc_date}.tgz $LOG/*.log $REYE/CEP/FiAdapter/Audit.${arc_date}.csv
... (3 Replies)
Discussion started by: pspriyanka
3 Replies
5. Shell Programming and Scripting
Say you don't want to unpack the whole thing, just individual files or directories within a .tgz. How to do this? (1 Reply)
Discussion started by: stevensw
1 Replies
6. Shell Programming and Scripting
Hi All,
I am completely stuck here.
I have a set of files (with names A.txt, B.txt until L.txt) which contain words like these:
computer
random access memory
computer networking
mouse
terminal
windows
All the files from A.txt to L.txt have the same format i.e. complete words in... (2 Replies)
Discussion started by: shoaibjameel123
2 Replies
7. Shell Programming and Scripting
Hello everyone. I am new to shell scripting and i am required to create a shell script, the purpose of which i will explain below.
I am on a solaris server btw.
Before delving into the requirements, i will give youse an overview of what is currently in place and its purpose.
... (2 Replies)
Discussion started by: goddevil
2 Replies
8. Solaris
I have some Solaris 9 systems and I'm interested in using the "fm" audit class to track changes to sensitive files but it's too verbose for it to be auditing to that level for EVERY file, so I was wondering if there were a way of restricting the audit of those events to particular files.
I... (0 Replies)
Discussion started by: thmnetwork
0 Replies
9. Shell Programming and Scripting
Hey,
I have number of .tgz files and want to extract the file with the ending *results.txt from each one.
I have tried
for file in *.tgz; do tar --wildcards -zxf $file *results.txt; doneas well as
list=$(ls *.tgz)
for i in $list; do tar --wildcards -zxvf $i *.results.txt; done... (1 Reply)
Discussion started by: jfern
1 Replies
10. UNIX for Dummies Questions & Answers
Hello,
i'm having a problem here with FreeBSD 9.2 . I've created a directory and downloaded the latest ntp-4.2.8p1-beta2 from ntp.org. Untar then into the directory and then
./configure all went OK. Then i had to modify some parameters in the config.h created with ./configure . Then
make... (2 Replies)
Discussion started by: Board27
2 Replies
LEARN ABOUT NETBSD
postinstall
POSTINSTALL(8) BSD System Manager's Manual POSTINSTALL(8)
NAME
postinstall -- check and fix installation after system upgrades
SYNOPSIS
postinstall [-a arch] [-d destdir] [-m machine] [-s {srcdir | tgzdir | tgzfile}] operation [item [...]]
DESCRIPTION
The postinstall utility performs post-installation checks and/or fixes on a system's configuration files. It is especially useful after sys-
tem upgrades, e.g. after updating from NetBSD 1.6.2 to NetBSD 2.0. The items to check or fix are divided in two groups: enabled by default
and disabled by default. The latter are items that are dangerous for some reason, for example because they remove files which may be still
in use. If no items are provided, the default checks or fixes are applied. Those which are disabled by default must be provided explicitly.
Supported options:
-a arch MACHINE_ARCH. Defaults to machine of the host operating system.
-d destdir Destination directory to check. Defaults to /.
-m machine MACHINE. Defaults to machine of the host operating system.
-s {srcdir | tgzdir | tgzfile}
The location of the reference files, or the NetBSD source files used to create the reference files. This may be speci-
fied in one of three ways:
-s srcdir The top level directory of the NetBSD source tree. By default this is /usr/src.
-s tgzdir A directory in which reference files have been extracted from a binary distribution of NetBSD. The files
that are distributed in the ``etc.tgz'' set file must be present. The files that are distributed in the
``xetc.tgz'' set file are optional.
-s tgzfile The location of a set file (or ``tgz file'') such as ``etc.tgz'' or ``xetc.tgz'' from a binary distribu-
tion of NetBSD. Each set file is a compressed archive containing reference files, which will be extracted
to the temproot directory. Multiple -s options may be used to specify multiple set files. The
``etc.tgz'' set file must be specified. The ``xetc.tgz'' set file is optional.
The operation argument may be one of:
check Perform post-installation checks on items.
diff [diff(1) options]
Similar to check, but also show the differences between the files.
fix Apply fixes that check determines need to be applied. Not all items can be automatically fixed by postinstall, and in some
cases an error will be reported, after which manual intervention will be required.
Conflicts between existing files in the target file system and new files from the NetBSD distribution are resolved by replac-
ing the existing file with the new file; there is no attempt to merge the files. See etcupdate(8) for an alternative update
method that is able to merge files.
help Display a short help.
list List available items, showing if they are enabled or disabled by default.
usage Same as help.
EXIT STATUS
The postinstall utility exits 0 on success, and >0 if an error occurs or a problem was found.
SEE ALSO
etcupdate(8)
HISTORY
The postinstall utility first appeared in NetBSD 1.6.
In NetBSD 4.0, the -s tgzfile option was added.
In NetBSD 5.0, the ability to specify multiple colon-separated files with a single -s option was deprecated.
BSD
October 4, 2008 BSD