Sponsored Content
Full Discussion: find command exec error
Top Forums UNIX for Dummies Questions & Answers find command exec error Post 302076398 by pavan_test on Monday 12th of June 2006 11:32:30 PM
Old 06-13-2006
find command exec error

Hi All,

i am writing a shell script in korn shell
which deletes all the files in a directory
once in every 10DAYS.

the directory has different format files.

the script has something like this;


cd /home/data/pavi
echo "Please Enter the Number of Days to search for"
read DAYS
echo "The entered number of days is $DAYS"
DOACTION="rm -rf"
find DD.* -maxdepth 1 -mtime +$DAYS -exec $DOACTION {} \;
find AA.* -maxdepth 1 -mtime +$DAYS -exec $DOACTION {} \;

the script is working fine DD.* extension.

But for those files with AA.* extension i am getting the following
error message;

pav.ksh[33]: find: Argument list too long.
there are total 22,309 files with AA.* extension.

can anyone please suggest me the best approach here,

thanks
pavi
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Find command with prune and exec

Hi, I'm using the following command to get a list of files on the system. find /releases -type f -exec ls -l > /home/sebarry/list.txt '{}' \; however, its searching a directory I don't want it to search so I know I have to use prune but I don't seem to be able to get prune and exec to work... (1 Reply)
Discussion started by: Sebarry
1 Replies

2. Shell Programming and Scripting

find command with exec doesnt work

Hi There, I have a script which finds for log files and removes them if the file has changed in the last day. The script runs fine without errors. The log file is still there. So, I decided to print the find command and run the command outside the script. Getting "Incomplete statement" Can you... (6 Replies)
Discussion started by: funtochat2002
6 Replies

3. Shell Programming and Scripting

find command with -exec

Hi People, I have a directory full of compressed files (.Z extention) In many of these files there is a string pattern (3800078163033) I want to find all file names which contain this string in their text. Regards, Abhishek (2 Replies)
Discussion started by: max29583
2 Replies

4. Shell Programming and Scripting

How to get the exit code of -exec in the find command

Hi I have a little problem with the find command in a script that I'm writing. The script should check if there are some files younger than 100 seconds and then syncronise them with rsync. My find command: find -type f -cmin -100 -exec rsync -a --delete directory1/ directory2/ When I... (8 Replies)
Discussion started by: oku
8 Replies

5. Shell Programming and Scripting

find command to use multiple -exec options

Hello All, Is there a way to make exec do a couple of operations on a single input from find? For example, find . -type d -exec ls -l "{}" ";" I would like to give the result of each "ls -l" in the above to a wc. Is that possible? I want to ls -l | wc -l inside exec. How do I... (1 Reply)
Discussion started by: prasanna1157
1 Replies

6. Shell Programming and Scripting

find command with -exec

Hi all, Please could someone help with the following command requirement. I basically need to find files NEWER than a given file and order the result on time. My attempt so far is as follows: find . -newer <file_name> -exec ls -lrt {} ;\ But I dont seem to get the right result... (12 Replies)
Discussion started by: jonnyd
12 Replies

7. UNIX for Dummies Questions & Answers

What does the '\' in find -exec command

Hi, I have two scripts that remove files. One works fine and is coded find -name "syst*" -mtime +1 -exec rm {} \; The other is almost the same - only thing missing is the '\'. On that script though I keep getting: rm syst1202.file ? etc Does the \ make that difference or is it a... (3 Replies)
Discussion started by: Grueben
3 Replies

8. Shell Programming and Scripting

Find and move command with exec

Hi all, I am trying to find files newer than a given file and them mv them to a new location. So I far I have: find . ! -newer <file_name> -exec ls -l {} \; and find . ! -newer <file_name> -exec mv /TEMP_LOCATION {} \; find is not liking this. Anyone know how to modify the last... (2 Replies)
Discussion started by: jonnyd
2 Replies

9. Shell Programming and Scripting

Linux find command seems to not transmit all the result to the '-exec command'

Hello. From a script, a command for a test is use : find /home/user_install -maxdepth 1 -type f -newer /tmp/000_skel_file_deb ! -newer /tmp/000_skel_file_end -name '.bashrc' -o -name '.profile' -o -name '.gtkrc-2.0' -o -name '.i18n' -o -name '.inputrc' Tha command... (3 Replies)
Discussion started by: jcdole
3 Replies
GRID-CA-CREATE(1)						  Globus Commands						 GRID-CA-CREATE(1)

NAME
grid-ca-create - Create a CA to sign certificates for use on a grid SYNOPSIS
grid-ca-create [-help] [-h] [-usage] [-version] [-versions] grid-ca-create [-force] [-noint] [-dir DIRECTORY] [-subject SUBJECT] [-email ADDRESS] [-days DAYS] [-pass PASSWORD] [-nobuild] [-g] [-b] [-openssl-help] [OPENSSL-OPTIONS] DESCRIPTION
The grid-ca-create program creates a self-signed CA certificate and related files needed to use the CA with other Globus tools. The grid-ca-create program prompts for information to use to generate the CA certificate, but the prompts may be avoided by using the command line options. By default, the grid-ca-create program creates the self-signed CA certificate, installs it on the current machine in its trusted certificate directory, and creates a source tarball which can be used to generate an RPM package for the CA. If the RPM package is installed on a machine, users on that machine can create certificate requests for user, host, or service identity certificates to be signed by the CA certificate generated by running grid-ca-create. If run as a privileged user, the grid-ca-create program creates the CA certificate and support files in ${localstatedir}/lib/globus/simple_ca and the CA certificate and signing policy are installed in the /etc/grid-security directory. Otherwise, the files are created in the ${HOME}/.globus/simpleCA directory. The full set of command-line options to grid-ca-create follows. In addition to these, unknown options will be passed to the openssl command when creating the self-signed certificate. -help, -h, -usage Display the command-line options to grid-ca-create and exit. -version, -versions Display the version number of the grid-ca-create command. The second form includes more details. -force Overwite existing CA in the destination directory if one exists -noint Run in non-interactive mode. This will choose defaults for parameters or those specified on the command line without prompting. This option also implies -force. -dir DIRECTORY Create the CA in DIRECTORY. The DIRECTORY must not exist prior to running grid-ca-create. -subject SUBJECT Use SUBJECT as the subject name of the self-signed CA to create. If this is not specified on the command-line, grid-ca-create will default to using the subject name cn=Globus Simple CA, ou=$HOSTNAME, ou=GlobusTest, o=Grid. -email ADDRESS Use ADDRESS as the email address of the CA. The default instructions generated by grid-ca-create tell users to mail the certificate request to this address. If this is not specified on the command-line, grid-ca-create will default to the $LOGNAME@$HOSTNAME -days DAYS Set the default lifetime of the self-signed CA certificate to DAYS. If not set, the grid-ca-create program will default to 1825 days (5 years). -pass PASSWORD Use the string PASSWORD to protect the CA's private key. This is useful for automating Simple CA, but may make it easier to compromise the CA if someone obtains a shell on the machine storing the CA's private key. -nobuild Disable building a source tarball for distributing the CA's public information to other machines. The source tarball can be created later by using the grid-ca-package command. -g Create a binary GPT package containing the new CA's public information. The package will be created in the current working directory. This package can be deployed by with the gpt-install tool. -b Create a binary GPT package containing the new CA's public information that is backward-compatible with GPT 3.2. Packages created in this manner will work with Globus Toolkit 2.0.0-5.0.x. EXAMPLES
Create a simple CA in $HOME/SimpleCA % grid-ca-create -noint -dir $HOME/SimpleCA C e r t i f i c a t e A u t h o r i t y S e t u p This script will setup a Certificate Authority for signing Globus users certificates. It will also generate a simple CA package that can be distributed to the users of the CA. The CA information about the certificates it distributes will be kept in: /home/juser/SimpleCA The unique subject name for this CA is: cn=Globus Simple CA, ou=simpleCA-grid.example.org, ou=GlobusTest, o=Grid Insufficient permissions to install CA into the trusted certifiicate directory (tried ${sysconfdir}/grid-security/certificates and ${datadir}/certificates) Creating RPM source tarball... done globus_simple_ca_0146c503.tar.gz ENVIRONMENT VARIABLES
The following environment variables affect the execution of grid-ca-create: GLOBUS_LOCATION Non-standard installation path of the Globus toolkit. SEE ALSO
grid-cert-request(1), grid-ca-sign(1), grid-default-ca(1), grid-ca-package(1) AUTHOR
University of Chicago Globus Toolkit 5.2.0 07/22/2011 GRID-CA-CREATE(1)
All times are GMT -4. The time now is 04:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy