0 2 * * * find/tftpboot-maxdepth 1-mtime +14-name "*.img"-exec rm-rf {} \;
Every 2 hours, go to search/tftpboot This level directory, the modification time is 14 days ago, suffix is img file, and delete them one by one;
crontab command format
Basic format:
* * * * * command
Time-sharing Weekly command
The 1th column represents minutes 1~59 per minute with * or */1
The 2nd column represents the hour 1~23 (0 means 0 points)
The 3rd column represents the date 1~31
The 4th column represents the month 1~12
5th Column Identification Number Week 0~6 (0 = Sunday)
6th List of commands to run
Command
Find/tftpboot-maxdepth 1-mtime +15-name "*.img"-exec rm-rf {} \;
Find/tftpboot-maxdepth 1-mtime +15-name "*.img"
Find/tftpboot This level directory, file modification time is 15 days ago, suffix. img file name,
-exec RM-RF {}
Once found, delete each found file;
\; It's a grammatical requirement, no special meaning.
Regular cleanup 2 weeks ago The specified directory specifies the suffix of the file at the specified level