Download ftp_delete_by_date.php and upload the file to your php enabled server. Download Now!
Open the phpinfo.php file included in the FTP Delete download in a browser window. Note the full path to php listed at the bottom of the page.
Add the ftp connection details to the file as needed. Set the $daysbackup value to the age in days at which files will be deleted. Setting this value to 7 for a folder containing daily backups will result in 7 days of backups being stored.
Use the full path to PHP from step 2 to create a cronjob that triggers ftp_delete_by_date.php once daily.
Example Cron Command:
1 0 * * * /your/full/path/to/php -q /path/to/ftp_delete_by_date.php >> ~/ftp_delete_log.txt
Be sure to adjust the file path as needed for your installation.