Reputation: 1697
I tried to code in bash an archiving script but I can't seem to get find() working with an interval in number of days.
The ranges I need to code are
find . -name "*.VER" -mtime -31 -exec mv '{}' /opt/html/31';' -print
find . -name "*.VER" -mtime -31 -mtime -62 -exec mv '{}' /opt/html/62 ';' -print
Is there a way to code my find() command to use a number of days range??
Upvotes: 3
Views: 5953
Reputation: 29021
I think you have to change the logic of + and - in the times:
find . -name "*.VER" -mtime +31 -mtime -62 -exec mv '{}' /opt/html/62 ';' -print
This tells: files with a mtime greater than 31 days but less than 61 days.
Upvotes: 12