Delete folders older than 30 days

Dear all,

i use incremental backup my data with .zip to my hard drive. what i need is i don't want the old .zip file older than 30 days. how to write a shell script automatically remove my external hard disc zip backup folders older than 30 days?

Regards,

!#/bin/bash
find /path/to/files/*.zip -mtime +30 -exec rm {} \;

Put that into a script and then add it to crontab.

crontab -e

00 12 * * * /path to script

that will run it at 12 every night

Thank you for the replay

that means it deleted the original backup (the first backup) to right? if that folder deleted it means the incremental doesn't work. how about keep the first backup and deleted the first old backup. also i think if this deleted system depends on dates it is now reliable because if the system date irrupt all data will be gone. what do you think?

thank you again.