02-27-2006
More help pls!!!
Infact, the expression worked fine, but what puzzles me now is the following tar
This is my shell script...
Archive=`(date +%Y%m%d)`
if [ -d searchdir ]
then
find searchdir -type f \( -name \*\.ksh -o -name \*\.sql -o -name \*\.ini \) | xargs tar -rf $Archive.tar
else
echo "searchdir is not a dir"
fi
The objective is to search for these file types on a daily basis and archive them into a tar file named with the corresponding date.
Any clues of where I'm mistaken?!
Regards
Sirisha
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
i was just wondering if any one had a good example of finding mutliple file types with the -o option or any other alternatives.
find . \( -name "*.txt" -o -name "*.tag" \)
for some reason i'm not having much luck and the man page isn't very descriptive.
what i am trying to do is find all... (6 Replies)
Discussion started by: Shakey21
6 Replies
2. Solaris
I have appended a tar file to my installation script so that while installing i can unzip from there (specifying the starting line number) and install a package.
This work fine if i add one tar file. But suppose i have to install different packages depending on the platform the script is run. i... (0 Replies)
Discussion started by: vikashtulsiyan
0 Replies
3. UNIX for Advanced & Expert Users
Hi,
On my Unix Server in my directory, I have 70 files distributed in the following directories (which have several other files too). These files include C Source Files, Shell Script Source Files, Binary Files, Object Files.
a) /usr/users/oracle/bin
b) /usr/users/oracle... (1 Reply)
Discussion started by: marconi
1 Replies
4. 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
5. Linux
Hi,
I'm using the following command to find the multiple requierd file types and its working fine
find . -name "*.pl" -o -name "*.pm" -o -name "*.sql" -o -name "*.so" -o -name "*.sh" -o -name "*.java" -o -name "*.class" -o -name "*.jar" -o -name "*.gz" -o -name "*.Z" -type f
Though... (2 Replies)
Discussion started by: vickramshetty
2 Replies
6. Shell Programming and Scripting
How can I pass $var_find variable as argment to find command?
test.sh
var_find=' \( -name "*.xml" -o -name "*.jsp" \) '
echo "${var_find}"
find . -type f ${var_find} -print
# Below statement works fine.. I want to replace this with the above..
#find . \( -name "*.xml" -o -name... (4 Replies)
Discussion started by: kchinnam
4 Replies
7. 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
8. Shell Programming and Scripting
Hi,
I would like to use find to search for multiple types. For example search for symlink and regular file but not directories, sockets etc.... Something like:
find . -type l,f -name "stuff"
But of course it does not work.
Is there any way to avoid an if statement and to do it faster?
... (0 Replies)
Discussion started by: Dedalus
0 Replies
9. Shell Programming and Scripting
Hi All,
I am new here but I have a scripting question that I can't seem to figure out with the "find" cmd.
What I am trying to do is to only have to run a single find cmd parsing the directories and output the different file types to induvidual files and I have been running into problems.... (3 Replies)
Discussion started by: swaters
3 Replies
10. UNIX for Beginners Questions & Answers
I'm looking for a way to inventory files on a webserver into a CSV file, and am particularly interested in certain types of files, like .php, .cgi, .pl, .py, .sh, etc. but also want the ability to find all files, including those with no extension, or specified extensions, as above, including files... (1 Reply)
Discussion started by: spacegoose
1 Replies