1. Kevin Chan
  2. backup-scripts

Commits

Kevin Chan  committed 1a3c9fe

Fixed disorganized reporting data sections in local_dir2tar script.

  • Participants
  • Parent commits f83238d
  • Branches default
  • Tags 0.1.32

Comments (0)

Files changed (1)

File local_dir2tar

View file
 
     echo
     echo "#######################################################################"
-    echo "# Tar Archive   : $tarball"
-    size=$(ls -l $tarball | awk '{print $5}')
-    echo "# Size          : $(echo "scale=2; $size / (1024 * 1024)" | bc) MB ($size bytes)"
     echo "# Deleting archives older than $obsolete"
 
     for file in `find . -name "${backups}" | sort`
     echo "#######################################################################"
     echo
     echo "# $TAR $tar_opts -f \"$tarball\" $xclude \"$src_name\""
-    echo
 
     "$TAR" $tar_opts -f "$tarball" $xclude "$src_name" || errors=$((errors + 1))
 
+    echo
+    echo "# Tar Archive   : $tarball"
+
+    if [ ! -f "$tarball" ]; then
+        echo "# ERROR -- cannot find tar archive: $tarball"
+    else
+        size=$(ls -l "$tarball" | awk '{print $5}')
+        echo "# Size          : $(echo "scale=2; $size / (1024 * 1024)" | bc) MB ($size bytes)"
+    fi
+    echo "#######################################################################"
+
 } >"$tmpfile" 2>&1
 
 cat "$tmpfile" >> "$log"