Run “bor_anon_delete.pl” from cron to remove borrower details with expiry date of 12 or more months
Submitted by KJOLIFFE on Tue, 2008-09-16 10:01.
I want to use the “bor_anon_delete.pl” script to remove details of borrowers with an expiry date of twelve months or over and run this from the cron. The script uses the argument “-bDD/MM/YYYY” to specify the date to check expired borrowers when used with the “-tEXPIREY” argument. The problem is the date needs to be exactly 12 months from the current date so I need to pass a variable into this argument if possible. Does anyone know if this is actually possible and how it can be achieved or does the script need to be run manually if specifying a date against the “-b” argument.



Running for a previous year
You could hack the script itself but the easiest way is to create a UNIX shell script to calculate the new date that then calls the anonymiser.
DAY=`date +%d`MONTH=`date +%m`
YEAR=`date +%Y`
YEAR=`expr $YEAR - 1`
NEW_DATE="$DAY/$MONTH/$YEAR"
bor_anon_delete.pl -pbor_anon_delete.param -b$NEW_DATE
There is probably a more elegant way of doing this and if you want to change month and day values it will be more complicated. Searching the web will find the code required but I think this will do what want
Brian Crampton
Developer, Talis