Find Command in the script throw error


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Find Command in the script throw error
# 1  
Old 01-25-2010
Find Command in the script throw error

Hi I have script that is developed to serch for 30 days old Directory & Files and then remove them ...

when i run it successfully removes the Directory & files & but it throw errors on the screen


..
..

+ find . -type f -mtime +30 -exec rm -f {} ;
+ exit


please help me ??

I got the answer thanks

find . -name "t*" -type d -mtime +30 | xargs rm -rf {} \;

Last edited by Beginner123; 01-25-2010 at 02:03 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk script to check and throw error for multiplication result

I need to multiply column1 and column3 data and need to compare it with column5. Need to check multiplication and Throw error if result is greater or less than column5 values, though difference of +/- 2 will be ok Ex - if column1 has 2.4 and column3 has 3.5, it will be ok if column5 have value... (13 Replies)
Discussion started by: as7951
13 Replies

2. Shell Programming and Scripting

find command -No such file error

Hi , I tried the below code to remove the files older that 30 days . #!/bin/ksh set -x file_path1="/home/etc" file_path2="/home/hst" file_nm="HST" days=30 find $file_path1/*$file_nm* -type f -mtime +$days -exec rm -f {} \; find $file_path2/*$file_nm* -type f -mtime +$days -exec rm... (3 Replies)
Discussion started by: smile689
3 Replies

3. Shell Programming and Scripting

find command error

Hi, We have a shell script which looks into a directroy for any folder older than 30 days and removes them. The command being used is find $ARCHIVE_DIR -type d -mtime +$PURGE_HIST_DAYS -exec rm -rf {} \; It removes some folders but then throw below errors for others: find:... (2 Replies)
Discussion started by: DejaVu
2 Replies

4. Shell Programming and Scripting

find command error

Hi folks, I am trying a small script to delete a files from multiple servers having a common pattern. I use this code for i in `seq -w 25 100` do echo "************host server-name*********" ssh -p 22022 server-name 'echo `hostname` && find /var/log -name "test*" ... (5 Replies)
Discussion started by: gauravsharma29
5 Replies

5. Shell Programming and Scripting

search line with more than two dots if so throw error

Hi, I have a requirement like i have to search a script and find names that conatins more than two dots, if so then throw error. For ex: a1.b1.comname here i have to find comname and check two dots. it will not throw error a1.b1.c1.comname here it contains more than 2dots it will throw... (3 Replies)
Discussion started by: swagat123
3 Replies

6. UNIX for Advanced & Expert Users

find command error

Executing "find /abc -follow -ls" the message "find: cycle detected for /abc/def/ghi/ What does this mean? Thanks... (2 Replies)
Discussion started by: twk
2 Replies

7. UNIX for Dummies Questions & Answers

if a file is empty throw an error

I want to count the number of lines in a file and store it in a variable if this count is zero i hv to throw an error ...is this syntax correct , but i am not getting the desired result I am not using -s option here as i am concerned about record count not the size #!/bin/ksh set $count1... (4 Replies)
Discussion started by: mavesum
4 Replies

8. Shell Programming and Scripting

throw a generic message upon error

hi all, in ksh, is there a way to throw a generic error message. i have lots of commands in my script and i didnt want to put if ; then doStuff(); else print "an error occured, please run script again"; fi around all the commands used. is there a way detect a command has... (1 Reply)
Discussion started by: cesarNZ
1 Replies

9. Shell Programming and Scripting

Perl Script Error with find command

Guys, I need to find all the files ending with either dmp or dmp.Z. This command is giving me error. @files =`find $path \(-name "*.dmp" -o -name "*.dmp.Z"\) -mtime +30`; sh: 0403-057 Syntax error at line 1 : `(' is not expected. Thanks in advance (4 Replies)
Discussion started by: MKNENI
4 Replies

10. UNIX for Advanced & Expert Users

Find accessed file in past 1 or 2 minutes, and throw mail.

Can Anyone tell me how to write the Script to "find file(s) in a directory that is being accessed in last 5 minutes, and if there is result of that find, then throw the mail ". Means throw the mail to a person regarding whoever and whenever a file is accessed in a directory. ASAP. Thnks. (2 Replies)
Discussion started by: varungupta
2 Replies
Login or Register to Ask a Question
UPGRADEDB(8)						      System Manager's Manual						      UPGRADEDB(8)

NAME
upgradedb - Directory Server script for upgrading the database SYNOPSIS
upgradedb [-a archivedir] [-Z serverID] [-f] [-v] [-d debuglevel] [-h] DESCRIPTION
Checks the DB version and if it has the old index formatting then it will rebuild the indexes. This is usually needed after migrating from older versions of Directory Server. This script must be run while the server is stopped. OPTIONS
A summary of options is included below: -n Backend Name The name of the LDBM database to reindex. Example: userRoot -a Database directory The full path to the database directory. -Z Server Identifier The server ID of the Directory Server instance. If there is only one instance on the system, this option can be skipped. -N Only checks whether any DNs in the database need to be updated. -h Display the usage. EXAMPLE
upgradedb -Z instance2 DIAGNOSTICS
Exit status is zero if no errors occur. Errors result in a non-zero exit status and a diagnostic message being written to standard error. AUTHOR
upgradedb was written by the 389 Project. REPORTING BUGS
Report bugs to http://bugzilla.redhat.com. COPYRIGHT
Copyright (C) 2013 Red Hat, Inc. Mar 5, 2013 UPGRADEDB(8)