The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Pattern Matching problem in UNIX maxmave Shell Programming and Scripting 2 06-03-2008 01:19 AM
problem with CASE pattern matching gummysweets Shell Programming and Scripting 2 03-18-2008 11:30 AM
pattern matching in an if-then lumix Shell Programming and Scripting 4 12-14-2007 04:25 PM
pattern matching problem rein Shell Programming and Scripting 8 10-26-2007 11:44 PM
Pattern Matching danhodges99 UNIX for Dummies Questions & Answers 2 02-27-2003 03:03 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-22-2008
namishtiwari namishtiwari is offline Forum Advisor  
Registered User
  
 

Join Date: Aug 2007
Location: Bangalore
Posts: 377
pattern matching problem

Code:
FilesToBackup='*.track* *.xml *.vm* *.gz Trace* TRACE* "*core*" *.out fcif_data_* esi_error_* *.rollback *.sed R.* APStatus_*
log* *.output* send_mail* downenv* check_env* intaspurge_db_* sqlnet.log *.rpt *.html *.csv "*TSC*"'

and i am using it like this-
echo Moving files from $(pwd):
        filesclause=$(/bin/echo "$FilesToBackup" | sed -e "s/ /\' -o -name \'/g")
        filesclause="-name '$filesclause'"
        # The following find will search the current dir and all subdirs except only name "centers"
        # Each file that is older than 1 day will be checked against the $FilesToBackup list
        # Those that match will be added to the tmpfile intasclean$$
        if [[ $dir != "." ]]; then
                eval find . -type f \\\( $filesclause \\\) | grep -v "^./centers" > $TEMPDIR/intasclean$$
        else
                echo $FilesToBackup | xargs /bin/ls -1 > $TEMPDIR/intasclean$$ 2>/dev/null
        fi
i have to look for core and TSC to remove the files or to take the backup with the script. When i run the script i am not getting any file with core and TSC even i created some files with touch. Is there any pattern matching problem in this.

Thanks...
  #2 (permalink)  
Old 05-23-2008
namishtiwari namishtiwari is offline Forum Advisor  
Registered User
  
 

Join Date: Aug 2007
Location: Bangalore
Posts: 377
Hi guys ,

provide any input in regard to the above question.
  #3 (permalink)  
Old 05-23-2008
vguleria vguleria is offline
Registered User
  
 

Join Date: Mar 2008
Location: India(Sarkaghat)
Posts: 28
Hi Namish,

Use the following to take backup of your files(or you can use 'mv' to move the files)

#***********************
#!/bin/bash
FILENAMES="*.track* *.xml *.vm* *.gz Trace* TRACE* "*core*" *.out fcif_data_* esi_error_* *.rollback *.sed R.* APStatus_*
log* *.output* send_mail* downenv* check_env* intaspurge_db_* sqlnet.log *.rpt *.html *.csv *TSC*"

for i in $FILENAMES
do
echo $i
find /path/to/search/directory/ -name "$i" -exec cp {} /path/to/backup/directory/ \;
done
exit 0
#******************************************************


Regards,
Vinod
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:00 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0