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
SCHEMA-RELOAD.PL(8)					      System Manager's Manual					       SCHEMA-RELOAD.PL(8)

NAME
schema-reload.pl - Directory Server perl script for updating the schema. SYNOPSIS
schema-reload.pl [-Z serverID] [-D rootdn] { -w password | -w - | -j filename } [-P protocol] [-d schemadir] [-v] [-h] DESCRIPTION
Manually reloads the schema files used by the Directory Server instance, either in the default location, or in user-specified locations. OPTIONS
A summary of options is included below: -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. -D Root DN The Directory Manager DN, or root DN. If not specified, the script will search the server instance configuration for the value. -w password The rootdn password. -w - Prompt for the rootdn password. -j password filename The name of the file that contains the root DN password. -d schemadir Gives the full path to the directory where the schema file is located. If this is not specified, the script uses the default schema directory, /etc/dirsrv/schema. -P protocol The connection protocol to connect to the Directory Server. Protocols are STARTTLS, LDAPS, LDAPI, and LDAP. If this option is skipped, the most secure protocol that is available is used. For LDAPI, AUTOBIND is also available for the root user. -v Display verbose ouput -h Display usage EXAMPLE
schema-reload.pl -Z instance3 -D 'cn=directory manager' -w password -P STARTTLS -d /LDAP/schema/ Note: security must be enabled to use protocol STARTTLS. If STARTTLS is not available it will default to next strongest/available protocol automatically. 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
schema-reload.pl 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 SCHEMA-RELOAD.PL(8)