expiry date for files?

Hi,

Is there any way i can give an expiry date for files that i create? For example, i would like to get a file deleted automatically after 60 days from the creation date. Is there any possibility for this in Unix?

Thanks,
RRVARMA

I suppose if you have permission to use 'at', you could schedule an at job whenever you create a file.

you may use the scheduler (cron) if you have permission to run a search command on the files you want to remove that are older than 60 days every night at midnight; directories may require a rm -R and to avoid failures you may want to employ rm -rf; below is a safe option

0 0 * * * /usr/bin/find /dir/with/files -ctime +60 -exec rm {} \; > /dev/null 2>&1

Interactive commands are ignored in cron.