I have an automated system for creating FTP accounts (vsftpd with jailed virtual users) that works well, but I still rely on manual cleanup of stale accounts.
My definition of a stale account is one in which no files or folders exist that are less than 30 days old.
So far, I can run this:
find /home/vsftpd -ctime +30 |awk -F'/' '{print $4}' |sort -u
Which will give me a list of folder containing at least one file older than 30 days. I could also run with -ctime -30 and, with some heavy looping, negate that list to get me the information I need.
I'm hoping there's a way to do this as a (moderately sensible) one-liner, but my find-foo fails me at this point. Can anyone help?
