3 # This script will redirect the backup directory to implement desired backup
6 # Currently we will use just a seven day format were we just move a link
7 # that represents the backup directory, to point to the day of the week.
11 # Configuration Parameters
14 if [ "$1" = "monthly" ]; then
23 echo "### Start of Backup Rotation ###"
24 echo "Using backup partition: $BACKUPPART"
26 echo -n "Remounting backup partition read-write ... "
27 if ( mount $BACKUPPART -o remount,rw &> /dev/null ) then
31 echo " There were problems remounting $BACKUPPART in read-write mode!"
32 echo "Rotation not made!"
33 echo "### End of Backup Rotation ###"
37 echo -n "Checking that no directory named \"$BACKUPDIR\" exists ... "
38 if [ -d $BACKUPPART/$BACKUPDIR -a ! -L $BACKUPPART/$BACKUPDIR ]; then
40 echo " Directory \"$BACKUPDIR\" exists. Can't create link!"
41 echo "Rotation not made!"
43 echo -n "Remounting backup partition read-only ... "
44 if ( mount $BACKUPPART -o remount,ro &> /dev/null ) then
48 echo " There were problems remounting $BACKUPPART in read-only mode!"
49 echo "### End of Backup Rotation ###"
52 echo "### End of Backup Rotation ###"
60 echo -n "Creating link: $BACKUPDIR --> $REALDIR ... "
61 if ( ln -snf $REALDIR $BACKUPDIR &> /dev/null ) then
65 echo " There were problems creating link!"
66 echo "Rotation not made!"
68 echo -n "Remounting backup partition read-only ... "
69 if ( mount $BACKUPPART -o remount,ro &> /dev/null ) then
73 echo " There were problems remounting $BACKUPPART in read-only mode!"
74 echo "### End of Backup Rotation ###"
77 echo "### End of Backup Rotation ###"
81 echo -n "Remounting backup partition read-only ... "
82 if ( mount $BACKUPPART -o remount,ro &> /dev/null ) then
86 echo " There were problems remounting $BACKUPPART in read-only mode!"
87 echo "### End of Backup Rotation ###"
90 echo "### End of Backup Rotation ###"