Hello,
I have a small webhosting business on a rented shared cPanel server. I'm trying to write a cron job for some of my accounts that will delete all trash email older than 24hours in the mail /.Trash folder once a day.
I've tried a few jobs similar to below, but none are working:
find /mail/domainname/*/.Trash/* -type f -mtime +1 | xargs rm -f
I think my folder structure is wrong as I keep receiving "no such file or directory" errors. 24 hour parameter isn't absolutely necessary as I could run a more generic job 2x a week.
Any help would be greatly appreciated.
Thanks everyone!
I have a small webhosting business on a rented shared cPanel server. I'm trying to write a cron job for some of my accounts that will delete all trash email older than 24hours in the mail /.Trash folder once a day.
I've tried a few jobs similar to below, but none are working:
find /mail/domainname/*/.Trash/* -type f -mtime +1 | xargs rm -f
I think my folder structure is wrong as I keep receiving "no such file or directory" errors. 24 hour parameter isn't absolutely necessary as I could run a more generic job 2x a week.
Any help would be greatly appreciated.
Thanks everyone!