1.9beta2: removed some extra "Not enough free inodes" messages
authorColas Nahaboo <colas@nahaboo.net>
Tue, 27 Feb 2018 10:56:47 +0100
changeset 24dadf1a600842
parent 23 4973ccdb6eed
child 25 844b3df1032a
1.9beta2: removed some extra "Not enough free inodes" messages
rsync-incr
     1.1 --- a/rsync-incr	Wed Oct 18 16:09:31 2017 +0200
     1.2 +++ b/rsync-incr	Tue Feb 27 10:56:47 2018 +0100
     1.3 @@ -1,6 +1,6 @@
     1.4  #!/bin/bash
     1.5  set -a
     1.6 -VERSION=1.9beta
     1.7 +VERSION=1.9beta2
     1.8  DATE=2017-06-13
     1.9  
    1.10  USAGE="rsync-incr [options] N sourcedir destdir
    1.11 @@ -52,9 +52,11 @@
    1.12  find_ld () { find `rootof "$1"` -xdev -name LAST_DATE -type f; }
    1.13  dfof () { df -mP "$1" |tail -1|awk '{print $4}'; }
    1.14  inodesok () { 
    1.15 +  local silent=false
    1.16 +  [ "$1" = -q ] && silent=true && shift
    1.17    local ipc=$(df -imP "$1" |tail -1|grep -oP ' \K[0-9]+(?=%)')
    1.18    if let 'ipc > inodespcmaxpc'; then 
    1.19 -    echo "Not enough free inodes (used: $ipc%), cleaning..."
    1.20 +    silent || echo "Not enough free inodes (used: $ipc%), cleaning..."
    1.21      return 1
    1.22    else
    1.23      return 0
    1.24 @@ -108,7 +110,7 @@
    1.25  	RSYNCINCR_LASTDATES=`find_ld "$destold"`
    1.26        fi
    1.27        freespace=`dfof "$destold"`
    1.28 -      if let 'freespace<n' || ! inodesok "$destold"; then
    1.29 +      if let 'freespace<n' || ! inodesok -q "$destold"; then
    1.30  	backup_siblings "$destold" | while read f; do
    1.31  	  freespace=`dfof "$destold"`
    1.32  	  if let 'freespace>=n' && inodesok "$destold"; then break