I would like to do the following:
A cron-script that:
1. Creates a current list of all users on the system (Something like grep '[A-z0-9]*=user' /home/e-smith/accounts|cut -d= -f1)
2. Use that list of users as an input for something that searches the whole file system for files older than one year (something like 'find / -ctime +365 -user $user') and then creates a list of all files, their location belonging to each particular user.
3. Finally the script should mail the list of old files to each particular user, preferably with a configurable explaining message like:
"Hi! This is an automatic report from your file server. You have probably forgotten the following files, belonging to you, since I see you haven't touched them in more than one year. Please take appropriate action!"
I can execute each part "manually", but I just don't have brain enough to glue those parts together into a script!!!
Anyone out there smarter than me who could assist?
(This "feature" would probably be of interest for other people as well, I suppose...)
Regards:
Lasse