File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -44,27 +44,25 @@ $ICMD/iput -bfr $LOCAL_MYSQL $REMOTE
4444#
4545echo ` date` " Deleting old LOCAL database backups"
4646# LOCAL_DELETIONS=`find $LOCAL/mysql_* -maxdepth 1 -type d -mtime +$DAYS_UNTIL_DELETE`
47- count=1
48- for d in ` ls -td /storage/coge/backup/* / | grep ' mysql_' `
47+ for d in ` ls -td $LOCAL /* / | grep ' mysql_' `
4948do
50- if [ $count -gt $MAX_LOCAL_BACKUPS ];
49+ if [ $MAX_LOCAL_BACKUPS -le 0 ];
5150 then
5251 echo deleting local $d
5352 rm -rf $d
5453 fi
55- (( count ++ ))
54+ (( MAX_LOCAL_BACKUPS -- ))
5655done
5756
5857echo ` date` " Deleting old REMOTE database backups (local & remote)"
59- count=1
60- for d in ` $ICMD /ils backup | grep ' mysql_' | sed ' s/.*\(mysql_.*\)/\1/' `
58+ for d in ` $ICMD /ils $REMOTE | grep ' mysql_' | sed ' s/.*\(mysql_.*\)/\1/' `
6159do
62- if [ $count -gt $MAX_REMOTE_BACKUPS ];
60+ if [ $MAX_REMOTE_BACKUPS -le 0 ];
6361 then
6462 echo deleting IRODS backup/$d
6563 $ICMD /irm -r backup/$d
6664 fi
67- (( count ++ ))
65+ (( MAX_REMOTE_BACKUPS -- ))
6866done
6967
7068#
You can’t perform that action at this time.
0 commit comments