@@ -127,18 +127,20 @@ fn_backup_compression(){
127127		fn_print_ok_nl " Completed: ${backupname} .tar.gz, total size $( du -sh " ${backupdir} /${backupname} .tar.gz" |  awk ' {print $1}' ) " 
128128		fn_script_log_pass " Backup created: ${backupname} .tar.gz, total size $( du -sh " ${backupdir} /${backupname} .tar.gz" |  awk ' {print $1}' ) " 
129129	fi 
130+ 	#  Remove lock file
131+ 	rm -f " ${tmpdir} /.backup.lock" 
130132}
131133
132134#  Clear old backups according to maxbackups and maxbackupdays variables
133135fn_backup_prune (){
134- 	#  How many backups there  are
135- 	info_distro.sh 
136- 	#  How many backups exceed maxbackups 
137- 	backupquotadiff= $(( backupcount - maxbackups )) 
138- 	#  How many backups exceed maxbackupdays 
139- 	backupsoudatedcount =$( find  " ${backupdir} " / -type f -name  " *.tar.gz "  -mtime + " ${maxbackupdays} " | wc -l ) 
140- 	#  If backup variables are set 
141- 	if  [  -n   " ${maxbackupdays}  "  ] && [  -n   " ${maxbackups} "  ] ;   then 
136+ 	#  Clear if backup variables  are set 
137+ 	if  [  -n   " ${maxbackups} "  ] && [  -n   " ${maxbackupdays} "  ] ;   then 
138+ 		 #  How many backups there are 
139+ 		info_distro.sh 
140+ 		 #  How many backups exceed maxbackups 
141+ 		backupquotadiff =$((  backupcount - maxbackups ) )
142+ 		 #  How many backups exceed maxbackupdays 
143+ 		backupsoudatedcount= $( find  " ${backupdir}  " / -type f -name  " *.tar.gz "  -mtime + " ${maxbackupdays} " | wc -l ) 
142144		#  If anything can be cleared
143145		if  [ " ${backupquotadiff} " -gt  " 0" || [ " ${backupsoudatedcount} " -gt  " 0" ;  then 
144146			fn_print_dots " Pruning" 
@@ -195,8 +197,4 @@ fn_backup_dir
195197fn_backup_compression
196198fn_backup_prune
197199fn_backup_start_server
198- 
199- #  Remove lock file
200- rm -f " ${tmpdir} /.backup.lock" 
201- 
202200core_exit.sh
0 commit comments