How to schedule for every two fridays with cron and/or at?

Sam Varshavchik mrsam at courier-mta.com
Fri Jul 16 23:29:41 UTC 2004


Mike Fedyk writes:

> Hi,
> 
> I have Amanda setup to run a daily backup Monday through Friday night.  
> That works fine.
> 
> But now I want to add a full backup every two weeks on Friday night and 
> I'm having trouble creating cron entries that don't have the commands 
> running on the same day for full and daily backups.
> 
> The best I have come up with is to run "at 20:45 Friday + 14 days" and 
> "at 20:45 Friday + 28 days" at the beginning of each month but I don't 
> think that will handle the situation correctly if the weeks don't 
> overlap correctly.
> 
> Any ideas on how to get this working would be very helpful.

Run the following script every Friday:

if test -f /etc/foo
then
     rm -f /etc/foo
else
     touch /etc/foo
     exit 0
fi

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20040716/09173336/attachment-0001.sig>


More information about the fedora-list mailing list