Operating System - HP-UX
1833796 Members
4551 Online
110063 Solutions
New Discussion

How do I know when I directories has been created or...

 
Henry Chua
Super Advisor

How do I know when I directories has been created or...

Hi guys,

I understand that the timestamp of a directory will be modified if there are changes in the directory. So how will i know if the time stamp represent a new directory is being create or that its content has been modified?

Thank u for your info!

regards
Henry
3 REPLIES 3
A. Clay Stephenson
Acclaimed Contributor

Re: How do I know when I directories has been created or...

You can only know by accident. The creation time is not part of the metadata carried in the inode. You can do a ls -lc to see the change time which MIGHT be the creation time but it is really the last time a chmod or chown was done.
If it ain't broke, I can fix that.
Henry Chua
Super Advisor

Re: How do I know when I directories has been created or...

Thanks Clay,

I am in the midst of scripting a cron job to move modified directories and files to a remote backup server. Do you think it is wise to use "find /directory -mtime -7" to list out the files and directories and then copy them to the remote location?

Merry X'mas

Regards
Henry
A. Clay Stephenson
Acclaimed Contributor

Re: How do I know when I directories has been created or...

The find command can be used as the basis for a script but you might find that the "rdist" command does just what you want with very little additional scripting. Man rdist for details.
If it ain't broke, I can fix that.