AIX - find command with mtime


 
Thread Tools Search this Thread
Operating Systems AIX AIX - find command with mtime
# 8  
Old 11-24-2015
Excellent!, It works fine!

Thank you very much.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find by name and mtime

Hi, I'm trying to find all files that have a .ksh and .p extension and that are 7 days old by using the below find command but it doesn't seem to as expected. It gives me random results.. Can someone point out what may be wrong? find . -name "*.ksh" -o -name "*.p" -mtime -7 (2 Replies)
Discussion started by: Jazmania
2 Replies

2. UNIX for Dummies Questions & Answers

Find using mtime

Hi, so I was using mtime and its not behaving the way I would think its supposed too. I have two pdf files. One modified today and another 6 months ago. I upload them to the solaris server. Then I run the below find statements. This finds my 2 files find *.pdf -type f -name '*.pdf' this finds... (2 Replies)
Discussion started by: vsekvsek
2 Replies

3. Shell Programming and Scripting

Help on find -mtime -exec

Hello people. Part of my script: echo "Compressing files older than 2 months in ${TEMP_DIR} directory ..." find ${DATA_DIR}/ -name '*.dat' -mtime 61 -exec compress {} \; #BELOW COMMAND DOES NOT WORK :-( <<<<<<----------- find ${DATA_DIR}/ -name '*.o.lines.*' -mtime 61 -exec compress {}... (2 Replies)
Discussion started by: drbiloukos
2 Replies

4. Shell Programming and Scripting

find -mtime +7

Dear all, find $ADMIN_DIR/$SID/arch/ -name '*.gz' -mtime +7 -exec rm {} \; is it retaining 7 days OR 8 days .gz files ? Thanks Prakash (10 Replies)
Discussion started by: prakashoracledb
10 Replies

5. Shell Programming and Scripting

What is -mtime 0 in find command?

What is "-mtime 0" option in find command. Does it consider the files that are of today lets say today is 4th Aug or will include files 24 hrs past from the current time???? (3 Replies)
Discussion started by: sachinkl
3 Replies

6. UNIX for Dummies Questions & Answers

find mtime syntax

Hi guys, I am looking for a way of moving all files out of a directory with a time stamp greater then the one I specify. Can anyone suggest a way of doing so? For example, move all files out of dir1 which were created after 17:00 into dir2. Thanks :) (1 Reply)
Discussion started by: JayC89
1 Replies

7. UNIX for Dummies Questions & Answers

(find) mtime vs. (unix) mtime

Hi I've made some test with perl script to learn more about mtime... So, my question is : Why the mtime from findfind /usr/local/sbin -ctime -1 -mtime -1 \( -name "*.log" -o -name "*.gz" \) -print are not the same as mtime from unix/linux in ls -ltr or in stat() function in perl : stat -... (2 Replies)
Discussion started by: hiddenshadow
2 Replies

8. UNIX for Dummies Questions & Answers

Problem with find command when used with mtime

All, Please find the below comand . I am trying to list the file that has not been accesed is past 14 days . But when you look at the display the directory "crecv1" which has date as today is displayed .. Why it is happening . I send this code instead of ls -ltr as rm -f -r in production... (4 Replies)
Discussion started by: arunkumar_mca
4 Replies

9. UNIX for Dummies Questions & Answers

problem with find and mtime

I am using HP-UNIX , The below command doesnt display anything although i have changed a file in the directory by toutch -t 200010101800 nfile find /tmp/transfer/ -name "*.*" -mtime +1 Any problrm with the find command i written . .Please help ??.. Thanks, Arun (4 Replies)
Discussion started by: arunkumar_mca
4 Replies

10. UNIX for Dummies Questions & Answers

find . -mtime

...what am i doing wrong?? I need to find all files older than 30 days and delete but I can't get it to pull details for ANY + times. The file below has a time stamp which is older than 1 day, however if I try and select it using any of the -time flags it just doesn't see it. (the same thing... (1 Reply)
Discussion started by: topcat8
1 Replies
Login or Register to Ask a Question
DATETIME.CREATEFROMFORMAT(3)						 1					      DATETIME.CREATEFROMFORMAT(3)

DateTime::createFromFormat - Returns new DateTime object formatted according to the specified format

       Object oriented style

SYNOPSIS
publicstatic DateTime DateTime::createFromFormat (string $format, string $time, [DateTimeZone $timezone]) DESCRIPTION
Procedural style DateTime date_create_from_format (string $format, string $time, [DateTimeZone $timezone]) Returns new DateTime object formatted according to the specified format. PARAMETERS
o $format - The format that the passed in string should be in. See the formatting options below. In most cases, the same letters as for the date(3) can be used. The following characters are recognized in the $format parameter string +--------------------------+--------------------------------------+---+ | $format character | | | | | | | | | Description | | | | | | | | Example parsable values | | | | | | +--------------------------+--------------------------------------+---+ | | | | | Day | | | | | | | | | --- | | | | | | | | --- | | | | | | | | | | | d and j | | | | | | | | | Day of the month, 2 digits with or | | | | without leading zeros | | | | | | | | | | | | 01 to 31 or 1 to 31 | | | | | | | | | | | D and l | | | | | | | | | A textual representation of a day | | | | | | | | | | | | Mon through Sun or Sunday through | | | | Saturday | | | | | | | | | | | S | | | | | | | | | English ordinal suffix for the day | | | | of the month, 2 characters. It's | | | | ignored while processing. | | | | | | | | | | | | st, nd, rd or th. | | | | | | | | | | | z | | | | | | | | | The day of the year (starting from | | | | 0) | | | | | | | | | | | | 0 through 365 | | | | | | | | | | | Month | | | | | | | | | --- | | | | | | | | --- | | | | | | | | | | | F and M | | | | | | | | | A textual representation of a month, | | | | such as January or Sept | | | | | | | | | | | | January through December or Jan | | | | through Dec | | | | | | | | | | | m and n | | | | | | | | | Numeric representation of a month, | | | | with or without leading zeros | | | | | | | | | | | | 01 through 12 or 1 through 12 | | | | | | | | | | | Year | | | | | | | | | --- | | | | | | | | --- | | | | | | | | | | | Y | | | | | | | | | A full numeric representation of a | | | | year, 4 digits | | | | | | | | Examples: 1999 or 2003 | | | | | | | | | | | y | | | | | | | | | A two digit representation of a | | | | year (which is assumed to be in the | | | | range 1970-2069, inclusive) | | | | | | | | Examples: 99 or 03 (which will be | | | | interpreted as 1999 and 2003, | | | | respectively) | | | | | | | | | | | Time | | | | | | | | | --- | | | | | | | | --- | | | | | | | | | | | a and A | | | | | | | | | Ante meridiem and Post meridiem | | | | | | | | | | | | am or pm | | | | | | | | | | | g and h | | | | | | | | | 12-hour format of an hour with or | | | | without leading zero | | | | | | | | | | | | 1 through 12 or 01 through 12 | | | | | | | | | | | G and H | | | | | | | | | 24-hour format of an hour with or | | | | without leading zeros | | | | | | | | | | | | 0 through 23 or 00 through 23 | | | | | | | | | | | i | | | | | | | | | Minutes with leading zeros | | | | | | | | | | | | 00 to 59 | | | | | | | | | | | s | | | | | | | | | Seconds, with leading zeros | | | | | | | | | | | | 00 through 59 | | | | | | | | | | | u | | | | | | | | | Microseconds (up to six digits) | | | | | | | | Example: 45, 654321 | | | | | | | | | | | Timezone | | | | | | | | | --- | | | | | | | | --- | | | | | | | | | | | e, O, P and T | | | | | | | | | Timezone identifier, or difference | | | | to UTC in hours, or difference to | | | | UTC with colon between hours and | | | | minutes, or timezone abbreviation | | | | | | | | Examples: UTC, GMT, Atlantic/Azores | | | | or +0200 or +02:00 or EST, MDT | | | | | | | | | | | Full Date/Time | | | | | | | | | --- | | | | | | | | --- | | | | | | | | | | | U | | | | | | | | | Seconds since the Unix Epoch (Janu- | | | | ary 1 1970 00:00:00 GMT) | | | | | | | | Example: 1292177455 | | | | | | | | | | |Whitespace and Separators | | | | | | | | | --- | | | | | | | | --- | | | | | | | | | | | (space) | | | | | | | | | One space or one tab | | | | | | | | Example: | | | | | | | | | | | # | | | | | | | | | One of the following separation | | | | symbol: ;, :, /, ., ,, -, ( or ) | | | | | | | | Example: / | | | | | | | | | | |;, :, /, ., ,, -, ( or ) | | | | | | | | | The specified character. | | | | | | | | Example: - | | | | | | | | | | | ? | | | | | | | | | A random byte | | | | | | | | Example: ^ (Be aware that for UTF-8 | | | | characters you might need more than | | | | one ?. In this case, using * is | | | | probably what you want instead) | | | | | | | | | | | * | | | | | | | | | Random bytes until the next separa- | | | | tor or digit | | | | | | | | Example: * in Y-*-d with the string | | | | 2009-aWord-08 will match aWord | | | | | | | | | | | ! | | | | | | | | | Resets all fields (year, month, day, | | | | hour, minute, second, fraction and | | | | timzone information) to the Unix | | | | Epoch | | | | | | | | Without !, all fields will be set to | | | | the current date and time. | | | | | | | | | | | | | | | | | | | | | Resets all fields (year, month, day, | | | | hour, minute, second, fraction and | | | | timzone information) to the Unix | | | | Epoch if they have not been parsed | | | | yet | | | | | | | | | | | | Y-m-d| will set the year, month and | | | | day to the information found in the | | | | string to parse, and sets the hour, | | | | minute and second to 0. | | | | | | | | | | | + | | | | | | | | | If this format specifier is present, | | | | trailing data in the string will not | | | | cause an error, but a warning | | | | instead | | | | | | | | Use DateTime::getLastErrors to find | | | | out whether trailing data was | | | | present. | | | | | | +--------------------------+--------------------------------------+---+ Unrecognized characters in the format string will cause the parsing to fail and an error message is appended to the returned struc- ture. You can query error messages with DateTime::getLastErrors. If $format does not contain the character ! then portions of the generated time which are not specified in $format will be set to the current system time. If $format contains the character !, then portions of the generated time not provided in $format, as well as values to the left-hand side of the !, will be set to correspond- ing values from the Unix epoch. The Unix epoch is 1970-01-01 00:00:00 UTC. o $time - String representing the time. o $timezone - A DateTimeZone object representing the desired time zone. If $timezone is omitted and $time contains no timezone, the current timezone will be used. Note The $timezone parameter and the current timezone are ignored when the $time parameter either contains a UNIX timestamp (e.g. 946684800) or specifies a timezone (e.g. 2010-01-28T15:00:00+02:00). RETURN VALUES
Returns a new DateTime instance or FALSE on failure. EXAMPLES
Example #1 DateTime.createFromFormat(3) example Object oriented style <?php $date = DateTime::createFromFormat('j-M-Y', '15-Feb-2009'); echo $date->format('Y-m-d'); ?> Procedural style <?php $date = date_create_from_format('j-M-Y', '15-Feb-2009'); echo date_format($date, 'Y-m-d'); ?> The above examples will output: 2009-02-15 Example #2 Intricacies of DateTime.createFromFormat(3) <?php echo 'Current time: ' . date('Y-m-d H:i:s') . " "; $format = 'Y-m-d'; $date = DateTime::createFromFormat($format, '2009-02-15'); echo "Format: $format; " . $date->format('Y-m-d H:i:s') . " "; $format = 'Y-m-d H:i:s'; $date = DateTime::createFromFormat($format, '2009-02-15 15:16:17'); echo "Format: $format; " . $date->format('Y-m-d H:i:s') . " "; $format = 'Y-m-!d H:i:s'; $date = DateTime::createFromFormat($format, '2009-02-15 15:16:17'); echo "Format: $format; " . $date->format('Y-m-d H:i:s') . " "; $format = '!d'; $date = DateTime::createFromFormat($format, '15'); echo "Format: $format; " . $date->format('Y-m-d H:i:s') . " "; ?> The above example will output something similar to: Current time: 2010-04-23 10:29:35 Format: Y-m-d; 2009-02-15 10:29:35 Format: Y-m-d H:i:s; 2009-02-15 15:16:17 Format: Y-m-!d H:i:s; 1970-01-15 15:16:17 Format: !d; 1970-01-15 00:00:00 SEE ALSO
DateTime.__construct(3), DateTime.getLastErrors(3), checkdate(3), strptime(3). PHP Documentation Group DATETIME.CREATEFROMFORMAT(3)