HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
cancel
Showing results for 
Search instead for 
Did you mean: 

Housekeep script

 
Fenglin
Regular Advisor

Housekeep script

Hi

Can anyone explain to me what is the attached script doing?

Whats the meaning of
find /app/httpd -type f -mtime +2 -mtime +4 -exec basename {} \; > /root/temp1
?
Regards
Feng Lin
2 REPLIES
Steven Schweda
Honored Contributor

Re: Housekeep script

man find
man basename

It appears to be looking in "/app/httpd" for
plain files of a certain age range, and
storing their base names into "/root/temp1".

Re: Housekeep script

>-mtime +2 -mtime +4

Repeating both of these is useless with the AND, it only does the latter, modified in more than 4 days. If they wanted between 2 and 4, it should use: -mtime +2 ! -mtime +4

Then if there isn't a .md5 file, it gzips that file. And then if no .md5 file, it creates one.

Then it removes everything older than 180 days.