How to get timestamp of a file in HPUX


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to get timestamp of a file in HPUX
# 8  
Old 03-05-2011
As Perderabo implies you can access the exact timestamp of a file after downloading and installing the "perl" programming language. If you do not have "perl" already and cannot execute downloads we are back to using standard unix utilities.
Have you got a recent "perl"?
# 9  
Old 03-05-2011
It's been a while since I used HP-UX, but when I did perl was always in /usr/contrib/bin. It was an older Perl, but HP needed it to run some perl scripts they had written. /usr/contrib/bin/perl was a required component of HP-UX, not an optional add-on.
# 10  
Old 03-05-2011
/usr/contrib/perl was an ancient version. Again we need to know what the O/P has.
# 11  
Old 03-05-2011
Hi.

FWIW, the perl code ran correctly for me. The system was:
Code:
OS, ker|rel, machine: HP-UX, B.11.11, 9000/712
Distribution        : GenericSysName [HP Release B.11.11] (see /etc/issue)
perl 5.8.0

 perl is at:
perl: /usr/local/bin/perl /usr/contrib/bin/perl /usr/local/man/man1/perl.1

cheers, drl
# 12  
Old 03-05-2011
Thank you

Hey Methyl,

My o/s version is B.11.31 and to answer your question - Yes, I do have perl on my server.

I didn't use perl because I am not too well versed with it....for most of my tweaking, I use standard shell scripts (which I was trying to do even now) and sed and awk..

But thanks a lot for the info that "When a file is more than 6-months old it is not possible to display the "updated" timestamp in HP-UX (or umpteen standard unix variants) with a basic "ls" command."

I am not a unix expert. All I was doing was writing a shell script to fix a recurring software packaging problem in my environment - It required me to check timestamp of a file (X) and display all files in the library which are older than X.

I tried ls and I also looked up for various file related commands over internet but I could only find variants of "ls -l" ...which didnt serve my purpose...

Thanks a ton for your help...

Perderabo,

I am a fan of all your posts and the thread you posted is exactly what I wanted. Thanks a lot.
# 13  
Old 03-05-2011
We assume that you used "find /dir ! -newer filename" in the end?
This User Gave Thanks to methyl For This Post:
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Grep lines between last hour timestamp and current timestamp

So basically I have a log file and each line in this log file starts with a timestamp: MON DD HH:MM:SS SEP 15 07:30:01 I need to grep all the lines between last hour timestamp and current timestamp. Then these lines will be moved to a tmp file from which I will grep for particular strings. ... (1 Reply)
Discussion started by: nms
1 Replies

2. Shell Programming and Scripting

Picking the latest file based on a timestamp for a Dynamic file name

Hi , I did the initial search but could not find what I was expecting for. 15606Always_9999999997_20160418.xml 15606Always_9999999998_20160418.xml 15606Always_9999999999_20160418.xml 9819Always_99999999900_20160418.xml 9819Always_99999999911_20160418.xmlAbove is the list of files I... (4 Replies)
Discussion started by: chillblue
4 Replies

3. Shell Programming and Scripting

AIX : Need to convert UNIX Timestamp to normal timestamp

Hello , I am working on AIX. I have to convert Unix timestamp to normal timestamp. Below is the file. The Unix timestamp will always be preceded by EFFECTIVE_TIME as first field as shown and there could be multiple EFFECTIVE_TIME in the file : 3.txt Contents of... (6 Replies)
Discussion started by: rahul2662
6 Replies

4. Shell Programming and Scripting

To check timestamp in logfile and display lines upto 3 hours before current timestamp

Hi Friends, I have the following logfile. Currently time in india is 07/31/2014 12:33:34 and i have the following content in logfile. I want to display only those entries which contain string 'Exception' within last 3 hours. In this case, it would be the last line only I can get the... (12 Replies)
Discussion started by: srkmish
12 Replies

5. Shell Programming and Scripting

Identifying files with a timestamp greater than a given timestamp

I need to be able to identify files with file timestamps greater than a given timestamp. I am using the following solution, although it appears to compare files at the "seconds" granularity and I need it at the milliseconds. When I tested my solution, it missed files that had timestamps... (3 Replies)
Discussion started by: nkm0brm
3 Replies

6. UNIX for Dummies Questions & Answers

How to compare a file by its timestamp and store in a different location whenever timestamp changes?

Hi All, I am new to unix programming. I am trying for a requirement and the requirement goes like this..... I have a test folder. Which tracks log files. After certain time, the log file is getting overwritten by another file (randomly as the time interval is not periodic). I need to preserve... (2 Replies)
Discussion started by: mailsara
2 Replies

7. Shell Programming and Scripting

Getting a relative timestamp from timestamp stored in a file

Hi, I've a file in the following format 1999-APR-8 17:31:06 1500 3 45 1999-APR-8 17:31:15 1500 3 45 1999-APR-8 17:31:25 1500 3 45 1999-APR-8 17:31:30 1500 3 45 1999-APR-8 17:31:55 1500 3 45 1999-APR-8 17:32:06 1500 3 ... (1 Reply)
Discussion started by: vaibhavkorde
1 Replies

8. HP-UX

pwage-hpux-T for Trusted HPUX servers

I'm sharing this in case anybody needs it. Modified from the original solaris pwage script. This modified hpux script will check /etc/password file on hpux trusted systems search /tcb and grep the required u_succhg field. Calculate days to expiry and notify users via email. original solaris... (2 Replies)
Discussion started by: sparcguy
2 Replies

9. UNIX for Dummies Questions & Answers

I/O performance in HPUX file systems

Hi guys, what is the relation between I/O performance and file systems. I have a file systems called /dcs/data01 which is having 4Tb size. According our application we can split the file system like dcs/data01 -> 1Tb dcs/data02 -> 1Tb dcs/data03 -> 1Tb dcs/data04 -> 1Tb do you... (4 Replies)
Discussion started by: Davinzy
4 Replies

10. Shell Programming and Scripting

Need Script to Use CPUs on a HPUX server to simulate Workload Manager on HPUX.

I am running HPUX and using WLM (workload manager). I want to write a script to fork CPUs to basically take CPUs from other servers to show that the communication is working and CPU licensing is working. Basically, I want to build a script that will use up CPU on a server. Any ideas? (2 Replies)
Discussion started by: cpolikowsky
2 Replies
Login or Register to Ask a Question