Delete All Files in A Directory via cPanel Cron Job Hello, I have a directory with in website path is like that /home/cpanel-user/public_html/temp/garbage I have WHM/cPanel. Is there any way that it automatically delete all files with in garbage every hour automatically via corn.
I have a HostGator account and that command does not work. For me the following worked: find /home/<USER NAME>/then/add/folders/.Trash/cur -mtime +1 -execdir /bin/rm {} \+ Replace <USER NAME> with the user name on the account. I'm not cron expert but do understand code concepts. All I know is I tried a dozen ways using a simple cron command (don't have SSH access) to delete the emails from the trash folders for the many accounts and email boxes I have. This seemed to work best without writing fancier scripts that loop to find the .trash folders and delete files. For me it's not that bad to add this cron job to each account and have run once a day instead of having to log into Webmail and force the trash folder delete when logging out (since I use Entourage on my Mac to pull in the emails from multiple email addresses I use).