Find the answer to your Linux question:
Results 1 to 4 of 4
I could understand the idea of security "if I haven't touched the file in 9 days, and the timestamp was changed, I know someone was in my system". But, is ...
  1. #1
    Just Joined!
    Join Date
    Jan 2011
    Posts
    87

    What is the purpose of preserving timestamps?

    I could understand the idea of security "if I haven't touched the file in 9 days, and the timestamp was changed, I know someone was in my system". But, is there any other purpose for preserving timestamps?

  2. #2
    Just Joined!
    Join Date
    Mar 2011
    Location
    India
    Posts
    14
    The only purpose of time stamp is to denote at what time a event has occurred and it is basically used for that. In terms of security it is very useful.

  3. #3
    Linux Newbie
    Join Date
    Nov 2008
    Location
    Tokyo, Japan
    Posts
    243
    I don't think time stamps are for security. At least, I have never heard of them used for that purpose. If you want to check to make sure the contents of files haven't been changed, you need to use tools like "md5sum".

    Using the "touch" command can update the file's time stamp without even opening the file. This is mostly used for two reasons:
    1. To trick an incremental backup system to backup that file. Ordinarily, incremental backups only copy files that have newer timestamps than the last backup timestamp.
    2. To force a "make" script to re-compile all files that depend on that file. Make heavily uses timestamps to compute which files need to be re-compiled. To save time, it will only re-make files that are newer than the Makefile script itself.
    You should almost always preserve timestamps. The only time you don't want to preserve timestamps is if you want your system to treat all files as though they were created recently, for example, you want your system to treat all files in an archive as new files that were all created at the time that you unarchved them.

    Another reason not to preserve timestamps is when you are very stingy for file sizes. Timestamp information can take several bytes of extra space per file, which can add up if you are streaming an archive of hundreds of millions of small files over a network. If timestamp information is really not necessary, you can skip it to improve bandwidth and file size. But lately, disk space is cheap enough, and networks are fast enough, that skipping the time stamps won't really make noticeable difference, and timestamps can be pretty important in some situations you might not expect.
    Last edited by ramin.honary; 03-31-2011 at 07:47 AM.

  4. #4
    Just Joined!
    Join Date
    Mar 2011
    Location
    India
    Posts
    14
    Timestamps are used for security. I didn't mean that. Its just a way of security to know someooe has viewed ur file over a period of time when u was away.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...