Today (Saturday) We will make some minor tuning adjustments to MySQL.

You may experience 2 up to 10 seconds "glitch time" when we restart MySQL. We expect to make these adjustments around 1AM Eastern Daylight Saving Time (EDT) US.

Mtime or the equivalent for HP-UX

Login or Register to Reply

Thread Tools Search this Thread
# 8  
You could use perl to test if file is older that 3 days like this:

$ FILE=.profile
$  perl -e 'use File::stat;  my $INODE=stat("'$FILE'"); exit((time() - $INODE->mtime) < 3600*24*3);' && echo "File $FILE is old"
File .profile is old

Or (not a big perl coder so this could probably be simplified). Print filenames on stdin, older than 3 days:

$ ls | perl -e '
  use File::stat;
  while (my $fl = <STDIN>) { 
    chomp $fl ;
    my $INODE=stat($fl); 
    if(time() - $INODE->mtime > 3600*24*3) { 
       print $fl . "\n";

Last edited by Chubler_XL; 02-24-2019 at 07:07 PM.. Reason: Clean up formatting
# 9  
Chubler_XL - yes and no.

One problem - lpstat -o reports data from the print queue acceptance time, not the mtime of a file. In other words, you could send a 10 year old file to a print queue and acceptance time would be in the last few seconds. Try it if you have an HP-UX box handy.

Perl definitely is an option, but IIRC timelocal (and some other) and other date time .pm files were not on the last HP-UX boxes I worked on ( 11i v3 (B.11.31), 2007-02-01 ) as default installed items in perl.

Adding new perl modules requires going to cpan and downloading, then creating library directories and environment variables. And then coding. No biggie. But it is a system change.

My effort was simply in C because this was just a quick effort for me. And hoping it was useful. The missing year number part was what got me interested.
These 2 Users Gave Thanks to jim mcnamara For This Post:
Login or Register to Reply

Thread Tools Search this Thread
Search this Thread:
Advanced Search

10 More Discussions You Might Find Interesting

1. 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

2. Red Hat

-mtime command

Hello, what this command do. find /oracle/u01/app/oracle/admin/rdz/udump/ -name "*.trc" -mtime +1 Thanks, Umair (1 Reply)
Discussion started by: umair
1 Replies

3. 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

4. AIX

-mtime Problem

Hi, I'm using command "find . -mtime +10 -type f -print" to list the files 10 days or older but I'm getting the files which are even created today. What am I doing wrong? Thanks. (1 Reply)
Discussion started by: Gbyte
1 Replies

5. Shell Programming and Scripting


Hi, I've some files of some past days and everyday some new files are also getting added to the same. Now how can i use mtime to get the files of the current date i.e if i want the files of 25th feb 2009 and if im finding the files on 25th 12:10 am then i should only get the files after... (4 Replies)
Discussion started by: ss_ss
4 Replies

6. UNIX for Dummies Questions & Answers

-mtime +30

Hello, Can someone help me to understand the following: find /test/rman/ -mtime +30 -exec rm '{}' \; What does -mtime +30 mean? Thanks! (1 Reply)
Discussion started by: Blue68
1 Replies

7. Shell Programming and Scripting


hi, :) consider the following statement find . -type f -mtime -1 -print here what is the use of -1 option. any help? cheers RRK (7 Replies)
Discussion started by: ravi raj kumar
7 Replies

8. UNIX for Dummies Questions & Answers

mtime help!!!!!

thank you for the help. (2 Replies)
Discussion started by: scooter17
2 Replies

9. 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

10. UNIX for Dummies Questions & Answers

mtime vs ctime

:D i have a slight problem and would appreciate if someone could clarify the confusion.. i use find alot and so far i have done ok.. but it just struck me a couple of days ago that I am not quite sure what the difference between the modification time and the change time as in ctime and mtime and... (3 Replies)
Discussion started by: moxxx68
3 Replies

Featured Tech Videos