1. create the script to find files older than 30 days and delete the files, suppose the script file name is deletefile
can use this
find /home/mujoko/archive/ -mtime +30 -exec rm {} \; // find files the older than 30 days in /home/mujoko/archive/ folder, make sure there is space after rm and before {}
or
find /home/mujoko/archive/ -mtime +30 |xarsg rm // using this script its possible we face error too many parameters if the files is to many to delete
2. Login as root
3. Configure crontab by execute
crontab -e mujoko //replace mujoko by your own username
4. Edit crontab by adding
30 1 * * * /home/mujoko/deletefile //deletefile is the file you create at step 1
5. Save your crontab.
Walaaaa, your file within /home/mujoko/archive will be deleted when the files is older than 30 days.