Hello
My patch should use 28 days instead of 31 for the month length:
+EXPIRED_DAYS=`expr $((($MONTHS_TO_KEEP * 28) - 1))`
The script should then correctly keep $MONTHS_TO_KEEP monthly backups, with
0 <= $MONTHS_TO_KEEP <= 12 .
Best regards
Francois Scheurer
PS: the monthly backup of February of bissextile year will be wrongly
deleted if $MONTHS_TO_KEEP = 12 and if it is the oldest backup. I think it
is not a big issue as long as 11 backups remains. Solving this issue will
require the script to be re-written differently.
--
View this message in context:
http://postgresql.nabble.com/patch-to-fix-retention-in-pg-backup-rotated-sh-tp5896424p5896738.html
Sent from the PostgreSQL - www mailing list archive at Nabble.com.