How to get the original create timestamp?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users How to get the original create timestamp?
# 1  
Old 08-20-2008
How to get the original create timestamp?

How do i get the original create timestamp in Unix?

I tried "ctime" but this gives me the change timestamp which changes with changes to inode (owner, permissions, etc.).

I need the timestamp when the file was originally created.

Thanks in advance!
# 2  
Old 08-20-2008
I believe there is no embedded way of knowing the original timestamp. The ext2/ext3 inode structure looks like this:
Code:
struct ext2_inode {
        __u16   i_mode;         /* File mode */
        __u16   i_uid;          /* Low 16 bits of Owner Uid */
        __u32   i_size;         /* Size in bytes */
        __u32   i_atime;        /* Access time */
        __u32   i_ctime;        /* Inode change time */
        __u32   i_mtime;        /* Modification time */
        __u32   i_dtime;        /* Deletion Time */
        __u16   i_gid;          /* Low 16 bits of Group Id */
        __u16   i_links_count;  /* Links count */
        __u32   i_blocks;       /* Blocks count */
        __u32   i_flags;        /* File flags */
(...)

No reference to what you wish.
# 3  
Old 08-20-2008
created timestamp for a file is not stored anywhere ( in the inode ) you could retrieve only modified time stamp, last accessed timestamp
# 4  
Old 08-20-2008
The answer depends on your filesystem. Older filesystems UFS, ext2, etc do not store this information. Most of the newer filesystems do keep this information somewhere within their metadata, e.g. ext4 in crtime (creation timestamp), UFS2 in di_birthdate.
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

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

3. Shell Programming and Scripting

Replacing Date in the file with Create date and timestamp

Hello, I have files that with a naming convention as shown below. Some of the files have dates in the file name and some of them don't have dates in the file name. imap-hp-import-20150917.txt imap-dell-gec-import-20150901.txt imap-cvs-import-20150915.txt imap-gec-import.txt... (8 Replies)
Discussion started by: Saanvi1
8 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

Append timestamp create .trg file for all content of an unzipped archive

Hi, I have a test.zip archive that contains test.zip --> (file_1.txt, file_2.txt , file_3.txt) I need to unzip the file like this, file_1_timestamp.txt file_1_timestamp.trg file_2_timestamp.txt file_2_timestamp.trg file_3_timestamp.txt file_3_timestamp.trg Could you please let me know... (7 Replies)
Discussion started by: Shandel
7 Replies

6. Shell Programming and Scripting

bash script to create txt files based on timestamp

Hi , please guide me for a bash script that will create a txt files and the name of the txt files will be as of timestamp so that each file name will be different from other and these files will be get created say after every 10 minutes in a folder(/home/p2000/sxs137), please guide me how would... (1 Reply)
Discussion started by: nks342
1 Replies

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

8. Shell Programming and Scripting

Merge CSV files and create a column with the filename from the original file

Hello everyone!! I am not completely new to shell script but I havent been able to find the answer to my problem and I'm sure there are some smart brains here up for the challenge :D. I have several CSV files that I need to combine into one, but I also need to know where each row came from.... (7 Replies)
Discussion started by: fransanchezoria
7 Replies

9. UNIX and Linux Applications

create 'day' tables based on timestamp in mysql

How would one go about creating 'day' tables based on the timestamp field. I have some 'import' tables which contains data from various days and would like to spilt that data up into 'days' based on the timestamp field in new tables. TABLE_IMPORT1 TABLE_IMPORT2 TABLE_IMPORT3 ... (2 Replies)
Discussion started by: hazno
2 Replies

10. Shell Programming and Scripting

ftp - get file and keep original timestamp?

Can you ftp (get) a file from another server and keep the timestamp on the file that is on the other server? ie. server1 server2 - Mar 12 12:30 /filename1 On Mar 15 at 13:00 server1 ftp to server2 and get /filename1 I want the file filename1 to have the date (Mar 12 12:30) on the file... (2 Replies)
Discussion started by: frustrated1
2 Replies
Login or Register to Ask a Question