unix - script for removing files that are 1 hour old -
this question has answer here:
- how delete files older x hours 7 answers
i need shell script runs every half hour on cron , removes files extension (*.arc) 1 hour ,
old tried mtime has option days old not in terms of hours
it helpful if can command or logic can run on types of os meaning (hp-ux,linux,rhel etc)
edit:(some of servers in work environment have os dont have mmin option there work around)
can please tell how wud use tmpwatch or temreaper delete files (*.arc) older 1 hr
thank you
maybe can you
how delete files older x hours
seems wanting do!
edit!
maybe considerd kind of hack, maybe code this
touch -t 03061000 /tmp/datefile
this supposed create file time stamp of march 6th 10:00
next can issue command
find . -newer /tmp/datefile -print
to find files thare newer file , remove them.
hope helps!
Comments
Post a Comment