02-06-2008
'find' and 'tar' combination
I'm trying to tar the files I get from the 'find' command result. However I can't make it run successfuly? This is for our archiving process.
Here is my script:
find /mnt/LOGS -mtime -10 -name "TUXLOG.*" -exec tar -cvf /mnt/LOGS/combine.tar {} \;
Im not sure why it is not working or it is even possible to use the 'tar' command with exec.
Appreciate your help.
10 More Discussions You Might Find Interesting
1. Solaris
Hello
I'm trying to use a combination of gunzip and tar to unpack and unzip a *.tar.gz file. I tried gunzip ~/myfile.tar.gz | gtar -x
This will unzip the file, but it won't unpack. Any hints?
thanks a lot
Dan (5 Replies)
Discussion started by: dwidmer
5 Replies
2. UNIX for Dummies Questions & Answers
When I am doing the first command the result shows all the files, links, directories except the ones that contain the word logs
find . -type f -o -type l -o -type d | grep -v logs
But when I am trying to do this even the logs are getting tarred
tar -cvf fdtvision.tar `find . -type f -o -type l... (2 Replies)
Discussion started by: venu_nbk
2 Replies
3. UNIX for Dummies Questions & Answers
Dear all,
I have to calculate sum of record count of files of the specified directory.
First I tried the following way which prints one or more outputs.
How can I sum of this output?
find /home/work/tmp/1/O/ -type f -print0 | xargs -0 wc -l | grep total
1666288 total
1073908 total
... (4 Replies)
Discussion started by: mr_bold
4 Replies
4. UNIX for Dummies Questions & Answers
Hello All,
I'm trying the following:find . -name "*" -exec grep -ln "IsAlpha" {} \;
It gives me file names only (having string "IsAlpha"), I want to get line numbers also, something like this: test 1: Line 52
test 1: Line 95 etc
Is it possible to obtain using grep & find only. (5 Replies)
Discussion started by: nervous
5 Replies
5. UNIX for Dummies Questions & Answers
Hi all,
4 files are returned when i issue 'find . -mtime -1 -type f -ls'.
./ora_475244.aud
./ora_671958.aud
./ora_934052.aud
./ora_934050.aud
However, when I issued the below command:
tar -cvf test.tar `find . -mtime -1 -type f`, the tar file only contains the 1st file -... (2 Replies)
Discussion started by: ahSher
2 Replies
6. 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
7. Shell Programming and Scripting
test.txt is the dynamic file but some of combination are fix
like below are the lines
;wonder_off =
;wonder_off = disabled
wonder_off =
wonder_off = disabled
the test.txt can content them in any order
#cat test.xt
;wonder_off =
;wonder_off = disabled
wonder_off =
wonder_off =... (5 Replies)
Discussion started by: SilvesterJ
5 Replies
8. 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
9. Shell Programming and Scripting
Hi,
I'm trying to use find in kshell (AIX) to find all files with perms of
write for other
AND
any execute bit set.
e.g:
r--r-x-w- would qualify
and rw-rw--wx would qualify
but ---rwxr-xr-x wouldn't qualify
So far, I've been trying something like this:
find . -type f -perm... (4 Replies)
Discussion started by: alanp36
4 Replies
10. UNIX for Beginners Questions & Answers
Hi,
I need to combined in 1 line the execution below :
find * -type f -mtime -$nb_days -print | xargs tar -cvf $MAITUT/BCK_DATA.tar
gzip $MAITUT/BCK_DATA.tar.gz
The fact that the TAR is very big, at the end I need to generate only the GZ file.
The option z on the tar... (2 Replies)
Discussion started by: royinfo.alain
2 Replies