purging files by day of week

purging files by day of week

Post by Karlon Wes » Tue, 16 Jul 1996 04:00:00




> 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 assume you'd run this in a cronjob every day of the week.
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


 
 
 

purging files by day of week

Post by Susan Malisc » Tue, 16 Jul 1996 04:00:00


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 appreciate any suggestions by direct e-mail as well as reply to the
newslist so that I don't miss anything.
Thanks very much,
Susan


 
 
 

purging files by day of week

Post by Dave Anders » Thu, 18 Jul 1996 04:00:00



>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

Sounds simple actually, run the job in cron 5 days a week skiping
sunday and monday, something like:

 45  23  *  *  2,3,4,5,6  /etc/cleanup.custom

My make it hard?

Dave

 
 
 

1. script to keep day, week, month backup file

If every night I copy file X sideways as backups/X[date], eg
backups/X03122004. Then also, every night, I want to purge the backups/
directory - BUT keeping last nights, last fridays and last months file X.

How can I achieve this in a shell script? I'd like to avoid perl if
possible. I have searched groups with no result. Please aim your response at
a scripting beginner!

Thanks in advance

2. /var/log missing; Have we been hacked?

3. How determine day of week from YYMMDD?

4. VPN Server software

5. How to findout the week of the day.

6. ufsdump from disk to disk (machine - machine)

7. how to change first day of week

8. security resources for tru64 v5.1

9. date -> day of week

10. Is there a way to compute what nth day of the year/week it is now?

11. Day of the week

12. First day of the week...

13. days of the week