Sponsored Content
Top Forums Shell Programming and Scripting shell script to remove old files and write to a log file Post 302266097 by Cassio Seffrin on Tuesday 9th of December 2008 12:08:25 PM
Old 12-09-2008
I make the changes to work fine in linux (my test was in slack)

2>&1
# --------------------------------------------------------------------------------
# Check run type - r report, d delete
# --------------------------------------------------------------------------------
RUN_TYPE=$1
if [ "$RUN_TYPE" != "r" ] && [ "$RUN_TYPE" != "d" ] ; then
echo "Invalid parameter" $RUN_TYPE
exit
fi
--------------------------------------------------------------------------------
# Set local variables
# --------------------------------------------------------------------------------
LOGFILE="/home/cassio/remove.log".`date '+%Y%m%d_%H%M%S'`
# --------------------------------------------------------------------------------
# Switch to backup directory. Find and report/delete files not accessed for two weeks.
# --------------------------------------------------------------------------------
cd /opt/wallis/webserver/logs/

if [ "$RUN_TYPE" == "r" ] ; then
find . -atime +8 | sort | xargs ls -l >>$LOGFILE
elif [ "$RUN_TYPE" == "d" ] ; then
find . -atime +8 -exec rm {} \; >>$LOGFILE
fi
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

How to write Flat Files by shell script using Oracle Database

Hello There.. I came to a situation where I need to write flat files using shell scripts, I need to pull the records from the oracle database and create the flat file, This process should be automated. Can any shell script expert out here to help me.. please.. Will be really glad to... (3 Replies)
Discussion started by: coolbuddy
3 Replies

2. UNIX for Advanced & Expert Users

Script to Extract time from log files and write to a excel

Can someone help me with writing a unix script for following requirement 1) I have a log file in which we have start time and end time (format: hh:mm:ss) Example: starting script on Thu Jun 5 20:50:52 Thu Jun 5 21:55:33 - Script Completed 2) I want to extract start time and end time of... (0 Replies)
Discussion started by: santosham
0 Replies

3. Shell Programming and Scripting

Script to Extract time from log files and write to a excel

Can someone help me with writing a unix script for following requirement 1) I have a log file in which we have start time and end time (format: hh:mm:ss) Example: starting script on Thu Jun 5 20:50:52 Thu Jun 5 21:55:33 - Script Completed 2) I want to extract start time and end time of... (0 Replies)
Discussion started by: santosham
0 Replies

4. UNIX for Dummies Questions & Answers

Script to Extract time from log files and write to a excel

Can someone help me with writing a unix script for following requirement 1) I have a log file in which we have start time and end time (format: hh:mm:ss) Example: starting script on Thu Jun 5 20:50:52 --------- Thu Jun 5 21:55:33 - Script Completed 2) I want to extract... (4 Replies)
Discussion started by: santosham
4 Replies

5. Shell Programming and Scripting

To write a shell script which groups files with certain pattern, create a tar and zip

Hi Guru's, I have to write a shell script which groups file names based upon the certain matching string pattern, then creates the Tar file for that particular group of files and then zips the Tar file created for the respective group of files. For example, In the given directory these files... (3 Replies)
Discussion started by: rahu_sg
3 Replies

6. UNIX for Dummies Questions & Answers

Create a shell script for write files with 2 parameters

Hello, I'm a newbie in shell script. So, i would like to create a shell script which take 2 IN parameters (PARAM1 and PARAM2). This script need to create 2 files as : I need to create this file /etc/apache2/sites-available/PARAM2 : <VirtualHost *:80> DocumentRoot "/home/PARAM1/www"... (0 Replies)
Discussion started by: chatlumo
0 Replies

7. Shell Programming and Scripting

Write an automated shell program(s) that can create, monitor the log files and report the issues for

Hi , Please help me getting this done. Write an automated shell program(s) that can create, monitor the log files and report the issues for matching pattern. (i) Conditions for creating log files. Log file is created with date (example 2010_03_27.log). If the log file size is 10 Mb for... (1 Reply)
Discussion started by: itian2010
1 Replies

8. Shell Programming and Scripting

How to write a shell script to display files in single path?

Hello friends, I am a script which dispalys a multiple files with their contents. for exm: suppose two file test1.txt and test2.txt. when I run my script it have to display the below O/P. test1.txt -rw-r----- 1 sranga staff 91 Sep 23 02:18 calc.sh -rw-r----- 1 sranga ... (2 Replies)
Discussion started by: sivaranga001
2 Replies

9. Shell Programming and Scripting

Need help to write a script for moving the log files to some other folder

Hi Experts, I want to write a script, based upon the following requirement 1) I am having 5 application $ cd logs $ ls -l drwxr-xr-x 2 natraj nat 5.0K Sep 20 10:25 one drwxr-xr-x 2 natraj nat 5.0K Sep 20 10:39 two drwxr-xr-x 2 natraj nat 1.5K Sep 20 10:58... (4 Replies)
Discussion started by: natraj005
4 Replies

10. Shell Programming and Scripting

Need help to write to log file whether the shell script call pass fail

I have the below script triggered daily at 330am in the morning, since last 7 days job not writing anything to database. below impala shell calling shell file which has sql , it is extracting data and loads to a flat file txt file. which is going wrong for last 1 week. need help, echo... (2 Replies)
Discussion started by: cplusplus1
2 Replies
GLOBUS-GATEKEEPER(8)						  Globus Toolkit					      GLOBUS-GATEKEEPER(8)

NAME
globus-gatekeeper - Authorize and execute a grid service on behalf of a user SYNOPSIS
globus-gatekeeper [-help] [-conf PARAMETER_FILE] [-test] [-d | -debug] {-inetd | -f} [-p PORT | -port PORT] [-home PATH] [-l LOGFILE | -logfile LOGFILE] [-lf LOG_FACILITY] [-acctfile ACCTFILE] [-e LIBEXECDIR] [-launch_method {fork_and_exit | fork_and_wait | dont_fork}] [-grid_services SERVICEDIR] [-globusid GLOBUSID] [-gridmap GRIDMAP] [-x509_cert_dir TRUSTED_CERT_DIR] [-x509_cert_file TRUSTED_CERT_FILE] [-x509_user_cert CERT_PATH] [-x509_user_key KEY_PATH] [-x509_user_proxy PROXY_PATH] [-k] [-globuskmap KMAP] [-pidfile PIDFILE] DESCRIPTION
The globus-gatekeeper program is a meta-server similar to inetd or xinetd that starts other services after authenticating a TCP connection using GSSAPI and mapping the client's credential to a local account. The most common use for the globus-gatekeeper program is to start instances of the globus-job-manager(8) service. A single globus-gatekeeper deployment can handle multiple different service configurations by having entries in the /etc/grid-services directory. Typically, users interact with the globus-gatekeeper program via client applications such as globusrun(1), globus-job-submit, or tools such as CoG jglobus or Condor-G. The full set of command-line options to globus-gatekeeper consists of: -help Display a help message to standard error and exit -conf PARAMETER_FILE Load configuration parameters from PARAMETER_FILE. The parameters in that file are treated as additional command-line options. -test Parse the configuration file and print out the POSIX user id of the globus-gatekeeper process, service home directory, service execution directory, and X.509 subject name and then exits. -d, -debug Run the globus-gatekeeper process in the foreground. -inetd Flag to indicate that the globus-gatekeeper process was started via inetd or a similar super-server. If this flag is set and the globus-gatekeeper was not started via inetd, a warning will be printed in the gatekeeper log. -f Flag to indicate that the globus-gatekeeper process should run in the foreground. This flag has no effect when the globus-gatekeeper is started via inetd. -p PORT, -port PORT Listen for connections on the TCP/IP port PORT. This option has no effect if the globus-gatekeeper is started via inetd or a similar service. If not specified and the gatekeeper is running as root, the default of 2119 is used. Otherwise, the gatekeeper defaults to an ephemeral port. -home PATH Sets the gatekeeper deployment directory to PATH. This is used to interpret relative paths for accounting files, libexecdir, certificate paths, and also to set the GLOBUS_LOCATION environment variable in the service environment. If not specified, the gatekeeper looks for service executables in /usr/sbin, configuration in /etc, and writes logs and accounting files to /var/log. -l LOGFILE, -logfile LOGFILE Write log entries to LOGFILE. If LOGFILE is equal to logoff or LOGOFF, then logging will be disabled, both to file and to syslog. -lf LOG_FACILITY Open syslog using the LOG_FACILITY. If not specified, LOG_DAEMON will be used as the default when using syslog. -acctfile ACCTFILE Set the path to write accounting records to ACCTFILE. If not set, records will be written to the log file. -e LIBEXECDIR Look for service executables in LIBEXECDIR. If not specified, the sbin subdirectory of the parameter to -home is used, or /usr/sbin if that is not set. -launch_method fork_and_exit|fork_and_wait|dont_fork Determine how to launch services. The method may be either fork_and_exit (the service runs completely independently of the gatekeeper, which exits after creating the new service process), fork_and_wait (the service is run in a separate process from the gatekeeper but the gatekeeper does not exit until the service terminates), or dont_fork, where the gatekeeper process becomes the service process via the exec() system call. -grid_services SERVICEDIR Look for service descriptions in SERVICEDIR. -globusid GLOBUSID Sets the GLOBUSID environment variable to GLOBUSID. This variable is used to construct the gatekeeper contact string if it can not be parsed from the service credential. -gridmap GRIDMAP Use the file at GRIDMAP to map GSSAPI names to POSIX user names. -x509_cert_dir TRUSTED_CERT_DIR Use the directory TRUSTED_CERT_DIR to locate trusted CA X.509 certificates. The gatekeeper sets the environment variable X509_CERT_DIR to this value. -x509_user_cert CERT_PATH Read the service X.509 certificate from CERT_PATH. The gatekeeper sets the X509_USER_CERT environment variable to this value. -x509_user_key KEY_PATH Read the private key for the service from KEY_PATH. The gatekeeper sets the X509_USER_KEY environment variable to this value. -x509_user_proxy PROXY_PATH Read the X.509 proxy certificate from PROXY_PATH. The gatekeeper sets the X509_USER_PROXY environment variable to this value. -k Use the globus-k5 command to acquire Kerberos 5 credentials before starting the service. -globuskmap KMAP Use KMAP as the path to the Grid credential to kerberos initialization mapping file. -pidfile PIDFILE Write the process id of the globus-gatekeeper to the file named by PIDFILE. ENVIRONMENT
If the following variables affect the execution of globus-gatekeeper: X509_CERT_DIR Directory containing X.509 trust anchors and signing policy files. X509_USER_PROXY Path to file containing an X.509 proxy. X509_USER_CERT Path to file containing an X.509 user certificate. X509_USER_KEY Path to file containing an X.509 user key. GLOBUS_LOCATION Default path to gatekeeper service files. FILES
/etc/grid-services/SERVICENAME Service configuration for SERVICENAME. /etc/grid-security/grid-mapfile Default file mapping Grid identities to POSIX identities. /etc/globuskmap Default file mapping Grid identities to Kerberos 5 principals. /etc/globus-nologin File to disable the globus-gatekeeper program. /var/log/globus-gatekeeper.log Default gatekeeper log. SEE ALSO
globus-k5(8), globusrun(1), globus-job-manager(8) University of Chicago 01/06/2012 GLOBUS-GATEKEEPER(8)
All times are GMT -4. The time now is 06:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy