Sponsored Content
Full Discussion: How to get this out put ?
Top Forums UNIX for Advanced & Expert Users How to get this out put ? Post 302577510 by m.d.ludwig on Tuesday 29th of November 2011 08:23:25 AM
Old 11-29-2011
Sidhartmellam,

Have you taken the time to look at the find manual pages? The -mtime option allows you to specify the number of days, for instance -mtime -5 will find files modified in the past five days. Finding files that have been modified an arbitrary time in the past is also easy with find, using the -newer option, it is just a bit more difficult to create a file with a modification time that is six hours old. If I were do this as a one shot, I'd:
Code:
$ MARK=$(mktemp)
$ ls -l $MARK
-rw-------. 1 ludwig staff 0 Nov 29 08:09 /tmp/tmp.KTAVlOVIKr

Now set the modification time to six hours ago:
Code:
$ touch --date='2011-11-29 02:09:00' $MARK
$ ls -l $MARK
-rw-------. 1 ludwig staff 0 Nov 29 02:09 /tmp/tmp.KTAVlOVIKr

And now find the files:
Code:
$ find /usr/abc/def -type f -name '*log' -newer $MARK -print

There are many ways to script this. A semi-portable method would be to:
Code:
#! /bin/ksh

MARK=$(mktemp)
trap "rm -f ${MARK}" EXIT

case "$(date +%Z)" in
    EST)     tz=GMT+11 ;;
    CST|EDT) tz=GMT+12 ;;
    MST|CDT) tz=GMT+13 ;;
    PST|MDT) tz=GMT+14 ;;
    PDT)     tz=GMT+15 ;;
esac

touch --date="$(TZ=$tz date '+%Y-%m-%d %H:%M:%S')" $MARK
find /usr/abc/def -type f -name '*log' -newer $MARK -print

This works in the continental United-States, YMMV.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

help need help on wine how to put in

how the hell do you put wine in because i don't know i have mandrake please tell how to put in (1 Reply)
Discussion started by: amicrawler
1 Replies

2. Shell Programming and Scripting

how to put a # in a file

Hello, Sir's, I would like to ask for help. This is my problem, i am working for a mbs for aix,hp-ux and solaris. And i am making a script that will automatically implement the said mbs. For example it will automatically change the permmisions of /usr/bin, /etc/passwd and so on. . . .... (7 Replies)
Discussion started by: invinzin21
7 Replies

3. UNIX for Dummies Questions & Answers

Where should I put the script?

Hi Guys, I'm a new to the UNIX. Let say I have a 1 simple script to stop and start vnc service. I want to use that script for support because my network connection to my client side is not stable and every time I have to use a long command to restart vnc. Where should I put that script?... (3 Replies)
Discussion started by: akuslive
3 Replies

4. Shell Programming and Scripting

How to put the default value

Hi guys Iam looking for a small help.I wrote a script. in that iam trying to take the default value ,when we press enter.this part iam struggling can somebody help please Example: do u need this server: For this one if we press enter it has to take server name as... (4 Replies)
Discussion started by: coolkid
4 Replies

5. Shell Programming and Scripting

how to put those in Dbase

Hi Experts, I have a file which contains- .. .. <?xml version='1.0' encoding='ISO-8859-1' standalone='no'?> <LogItems> <log logid="83efeae5190809080000080410"> <category>Upstream.TEL</category> <operation>MAKE</operation> <target>mms</target> <user>purple</user>... (3 Replies)
Discussion started by: thepurple
3 Replies

6. Shell Programming and Scripting

how to put it in a column

Simple question ..What is the easiest way to list my output in a column like so dddd dddd dddd dddd output dddd dddd dddd dddd Thanks (3 Replies)
Discussion started by: bombcan
3 Replies

7. UNIX for Dummies Questions & Answers

put $,.

original content: 0000000000 TIAA-CREF 0000000000 CAREMARK all said and done, i'd like to look like this: $00,000,000.00 TIAA-CREF $00,000,000.00 CAREMARK (2 Replies)
Discussion started by: tjmannonline
2 Replies

8. Solaris

How to sort df -h out put :

Hello every one , I am just trying to sort df -h out in a particular order to differentiate SAN disks and local disks .. does any body have any script or any useful command ?? thanks in advance .. (8 Replies)
Discussion started by: new2uniks
8 Replies

9. Shell Programming and Scripting

Need to put semicolon

Hi guys, I want to write script so that i can put semicolon after every numeric e.g input would be like that 50060E80058F49A4 Output should be 50:06:0E:80:05:8F:49:A4 Please help Thanks & Regards Nirjhar (11 Replies)
Discussion started by: nirjhar17
11 Replies

10. Shell Programming and Scripting

SFTP PUT

Hi, ServerA (SFTP server) ServerB (SFTP client) ServerB:> sftp user@ServerA ServerB:> put sample.txt ServerB:> get sample2.txt My question is that which machine will encrypt the sample.txt and sample2.txt files. Thanks (8 Replies)
Discussion started by: Arpit Narula
8 Replies
ECACCESS-ASSOCIATION-GET(1p)				User Contributed Perl Documentation			      ECACCESS-ASSOCIATION-GET(1p)

NAME
ecaccess-association-get - Get the Association Descriptive File SYNOPSIS
ecaccess-association-get -version|-help|-manual ecaccess-association-get [-debug] [-gateway name] [-template] association-name target-file DESCRIPTION
Get the Descriptive File for the ECtrans Association specified by the association-name parameter. Once downloaded, the target-file can be modified and processed through the ecaccess-association-put command. When using the -template option, if the Association already exists in the ECaccess Gateway Database, then the command return with an error. In order to create a new Association similar to an existing one the ecaccess-association-get command can be used to retrieve the Descriptive File of the existing Association. The file can then be updated and pushed to the ECaccess Gateway Database with the ecaccess- association-put command. An ECtrans Association Descriptive File contains parameters for ECtrans of the general form $name='value'. Each ECtrans Association has their own Descriptive File, and parameters in any given Descriptive File will be passed to the ECtrans container whenever a transfer is requested to the corresponding Association. Blank lines and leading spaces and tabs are ignored when they do not occur in single quoted strings. Lines whose first non-space character is a pound-sign (#) are comments, and are ignored. Note that comments are not allowed on the same line as parameters and don't persist when the Descriptive File is retrieved from the Gateway (they might however be used when Descriptive Files are archived on your system). The parameters are the following: active This is a boolean which indicate if the Association can be used by ECtrans or not (e.g. 'yes' or 'no'). You might want to deactivate an Association but still keep it in the ECaccess Gateway Database for later. comment This is a comment about your Association (e.g. 'Access to the archive system'). grantedUserList This is the list of ECMWF user identifiers which are allowed (other that you) to use this Association. Multiple users should be separated by a column (e.g. 'abc,def,ghi'). directory This is the directory where to download/upload the files from/to (e.g. '/tmp/data'). hostName This is the name of the host to connect to (e.g. 'hostname.example.ms'). login This is the login to use to connect to the host specified in the hostName parameter (e.g. 'anonymous'). protocol This is the protocol ECtrans will use to connect to the host specified in the hostName parameter. The list of available protocols for a Gateway can be displayed with the ecaccess-protocol-list command (e.g. 'genericFtp'). data This parameter can be split over multiple lines and contains various options for the protocol which have been selected for the Association (these options are passed verbatim to the Module which implement the protocol). In order to get the list of available options for a protocol please use the command ecaccess-association-protocol with the name of the protocol. The availabe options depends of the version of the ECaccess Gateway which is used to host the Association so it might be that some options are available for some Gateways and not available for others. An unknown option will be silently ignored by ECtrans. The format of an option is {protocol-shortname}.{option}={value} (e.g. ftp.port="21" would set the port option of the genericFtp module to "21"). An example of this parameter is given in the EXAMPLES section below. ARGUMENTS
association-name The name of the Association to retrieve the corresponding Descriptive File. target-file The name of the file where to download the Descriptive File. OPTIONS
-gateway name This is the name of the ECaccess Gateway where the Association is installed. It is by default the Gateway you are connected to. In order to get the name of your current Gateway you can use the ecaccess-gateway-name command. When using the commands at ECMWF the default Gateway is always "ecaccess.ecmwf.int". -template Allow creating a new Association Descriptive File for the ecaccess-association-put command. If the Association already exists then the command fails. -version Display version number and exits. -help Print a brief help message and exits. -manual Prints the manual page and exits. -debug Display the SOAP messages exchanged. EXAMPLES
ecaccess-association-get -template test ./test Create a new Association Descriptive File for an Association named test and store it in your current directory (file ./test). The file can then be edited and updated accordingly to your requirements. ecaccess-association-put -password ./test Create the Association with the previously updated ./test Association Descriptive File. ecaccess-association-get -gateway ecaccess.ecmwf.int ginko ./ginko Get the Descriptive File for the existing ginko Association on the ecaccess.ecmwf.int Gateway. ecaccess-association-put -gateway ecaccess.ecmwf.int ./ginko Push the Association back (once updated). This is an example of an Association Descriptive File: ############################################################## # Main Parameters ############################################################## $active='yes' $comment='Access to the archive system' $grantedUserList='abc,def,jhi' $directory='/tmp/data' $hostName='hostname.example.ms' $login='anonymous' $protocol='genericFtp' ############################################################## # Data ############################################################## $data=' ftp.mkdirs="yes" ftp.passive="no" ftp.port="21" ftp.suffix=".tmp" ftp.usetmp="yes"' Please note the multiple lines in the data parameter. SEE ALSO
ecaccess-association-delete, ecaccess-association-list, ecaccess-association-protocol, ecaccess-association-put and ecaccess. perl v5.14.2 2012-04-16 ECACCESS-ASSOCIATION-GET(1p)
All times are GMT -4. The time now is 09:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy