#!/bin/bash
#
# Move backup in a sepearte store to avoid retention
# 
# create a cronjob in this way:
# # Monthly rotation
# 55 23 1 * * /opt/rubi/bin/monthly 2>&1 | mail -s "Monthly backup rotation" root
set -x

mv `cat /backup/master/lastdst` /backup/master-monthly/
sed -i 's/\/master\//\/master-monthly\//' /backup/master/lastdst

mv `cat /backup/server/lastdst`   /backup/server-monthly/
sed -i 's/\/server\//\/server-monthly\//' /backup/server/lastdst

mv `cat /backup/backup/lastdst`  /backup/backup-monthly/
sed -i 's/\/backup\//\/backup-monthly\//' /backup/backup/lastdst
