If you have a requirement to cleanup older than 30 (or any number of days), days of folders and files from any designated location, you can do it via SQL Server Agent Job.
Just setup the job with Type as "PowerShell" and paste my code.
Configure and run it.
Ensure that you have powershell 2.0 configured.