|
If the files haven't been accessed and have the older timestamp then you can delete the emails using find command.We will look for any files that are more than 2 years (2*365=730 days) old. A simpler command can be as but it needs to be further modified as per requirements.
find /home/*/mail -type f -mtime +730 | xargs rm -vf
You can set it as cron. Before running the command you should see what find command finds:
find /home/*/mail -mtime +730 > /home/emails.list
__________________
Regards,
WebScHoLaR
"If you want to travel around the world and be invited to speak at a lot of different places, just write a UNIX Operating System."
|