Changeset 53 for scripts/usr/local/lib/7dtd/commands/backup.sh
- Timestamp:
- Jun 9, 2014, 2:00:26 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
scripts/usr/local/lib/7dtd/commands/backup.sh
r52 r53 13 13 local fileI 14 14 for fileI in "$SDTD_BACKUP_ROOT"/*; do 15 if [ $fileI -nt $LatestBackup -a -d $fileI]; then15 if [ "$fileI" -nt "$LatestBackup" -a -d "$fileI" ]; then 16 16 LatestBackup=$fileI 17 17 fi … … 64 64 (( num++ )) 65 65 if [ $num -gt $removeBut ]; then 66 rm $F66 rm -Rf $F 67 67 fi 68 68 done … … 82 82 local maxKBytes=$(( $SDTD_BACKUP_MAX_STORAGE*1024 )) 83 83 local curNumFiles=$(ls -t1 $SDTD_BACKUP_ROOT | wc -l) 84 while [ $(du -sk $SDTD_BACKUP_ROOT ) -gt $maxKBytes -a $curNumFiles -gt $keepMin ]; do84 while [ $(du -sk $SDTD_BACKUP_ROOT | tr '[:blank:]' ' ' | cut -d\ -f1) -gt $maxKBytes -a $curNumFiles -gt $keepMin ]; do 85 85 local toDel=$(ls -tr1 | head -n 1) 86 86 rm -Rf $toDel … … 90 90 91 91 for H in $(getHooksFor backup); do 92 $H $NewBackup 92 if [ "$SDTD_BACKUP_COMPRESS" = "all" ]; then 93 $H $NewBackup.tar.gz 94 else 95 $H $NewBackup 96 fi 93 97 done 94 98 }
Note:
See TracChangeset
for help on using the changeset viewer.