1833156 Members
3181 Online
110051 Solutions
New Discussion

Shell script in HP-UX

 
SOLVED
Go to solution
Ismagilov
Occasional Advisor

Shell script in HP-UX

How to find all files in all directories which date of creation will defend from current date more, than for 1 month and to place them in archive?
4 REPLIES 4
Piergiacomo Perini
Trusted Contributor

Re: Shell script in HP-UX

Hi Ismagilov,
(welcome to the ITRC forums)
and try this for finding files

find / -type f -mtime +30 -print -exec ls {} \;

Hope this help
regards
pg

ps:
And as Peter Godron says

Please also read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33
on how to reward any useful answers given to your questions.
Ismagilov
Occasional Advisor

Re: Shell script in HP-UX

Hi Piergiacomo Perini,
Thanks for the answer.

I wish to specify:
-mtime (modification date)
And how to find creation date?
john korterman
Honored Contributor
Solution

Re: Shell script in HP-UX

Hi Smagilov,

you cannot retrieve the creation time of a file, as unix does not registrate this - sorry.

regards,
John K.
it would be nice if you always got a second chance
Piergiacomo Perini
Trusted Contributor

Re: Shell script in HP-UX

Hi again,
you are right ...
maybe "ctime" could be more useful to you, but this option mean 'time of last change of file status information'.
In any case you could see "man find" for any other option.

hth
regards
pg