below is the command to delete file which is created more than 7 days ago.
find /home/system/backup/gitn_sdn_berhad/* -mtime +7 -type f -delete
then we put it inside crontab like below:
0 0 * * * find /home/system/backup/gitn_sdn_berhad/* -mtime +7 -type f -delete
your should only store latest 7 days of files after this cron is running.
Top comments (0)