Help me with script

Hello to all,

I have a folder containing several files user1.pop user2.pop and a folder containing the user's home directory, /home/user1 /home/user2.

Each .pop file contains a lastlogintime string, as follows <LastLoginTime> 05/04/2016 13:18:52 </ LastLoginTime>.

I would like to make a daily check and delete .pop files older than 8 months and folders for those users.

How can I do? My system is ubuntu.

Thank you

Hi,
Try below code:

find /home -name "*.pop" -type f -mtime +240 -exec rm -f {} \;

i am considering 30 days in a month.

Thanks and regards,
Bhupesh.

Thank you.

I resolved you can close the post .

Regards