Currently I am using following simple line script to take backup of server directory to remote FTP location
# Take backup to remote location
ncftpput -z -R -uusername -ppassword ftp.example.org /destination/directory /source/directory
Now, I just need to delete the backup from remote FTP which is older than 7 days. On normal directory location within the server I simply do it with following simple script
# Delete backups older than 7 days
find /backup -name '*' -type d -mtime +6 -exec rm -rfv "{}" \;
But, running the same is not working on FTP, is there any way I can delete FTP remote location data older than 7 days? may be via lftp or any other command