Hi,
I need a shell script to remove the files older than a week in a directoy and if necessary to zip the files.
check "find" command.
hello,
for example:
By crontab use :
40 20 * * 1-6 find /path -name "*" -mtime +8 -exec rm -f {} \;
Delete all files older than 8 days in the directory by cron on day 1-6 at 08:40 pm.
Regards