> We have a secure ftp server that is setup to retain files for three days.
> Once they are older than three days, we intended to use the following to
> purge the appropriate directories:
> find /ftp/pub -mtime +3 -exec rm -rf {} \;
> However, we are anticipating that weekends are going to be a problem. If
> the file arrives for pickup on the server on a Thursday or Friday, it
> really won't allow the recipient the two following days to pick it up.
> For files arriving on Thursday or Friday, we'd like to keep them on the
> server until Monday and Tuesday, respectively. Does anyone know of an
> existing routine that would accommodate this more intelligent purging
> method, or any utilities that might be more robust? Incidentally, we are
> running wu-ftp on AIX 3.2.5.
I'd suggest:
1) Don't run it on Monday, The Sunday run will delete wednesday drops
2) Change the 3 to 4 on Tuesday, to leave the Friday drops
3) Run it as is Wednesday thru Sunday
Assume the script took one parm for the number of days, then the
crontab file might look _something_ like:
01 0 * * 0,3-6 /opt/bin/purgeftp_script 3
01 0 * * 2 /opt/bin/purgeftp_script 4
And you're done.
--
Karlon West