#839 Issue closed: /usr/share/rear/backup/NETFS/default/50_make_backup.sh: line 133: 2.16061e+09: syntax error: invalid arithmetic operator (error token is ".16061e+09")

Labels: waiting for info, support / question

alxndr13 opened issue at 2016-05-15 17:18:

  • rear version:
    Relax-and-Recover 1.18 / Git
  • OS version:
Distributor ID: elementary OS
Description:    elementary OS Freya
Release:    0.3.2
Codename:   freya
  • rear configuration file: (/etc/rear/local.conf)
# Default is to create Relax-and-Recover rescue media as ISO image
# set OUTPUT to change that
# set BACKUP to activate an automated (backup and) restore of your data
# Possible configuration values can be found in /usr/share/rear/conf/default.conf
# This file (local.conf) is intended for manual configuration. For configuration
# through packages and other automated means we recommend creating a new
# file named site.conf next to this file and to leave the local.conf as it is. 
# Our packages will never ship with a site.conf.
  • Brief description of the issue:

Hangs after creating the tar archive.. looked in the logs and found this issue..

jsmeix commented at 2016-05-17 10:37:

Without debug logging information
it is in parctice impossible to guess the reason
what lets it fail in your particular case
in your particular environment on your particular system
(for me it "just works" but I do not run "elementary OS Freya").

Because rear is written entirely as bash scripts,
debugging rear is usual bash debugging.

To debug rear run it both with the '-d' option (log debug messages) and with the '-D' option (debugscript mode) to log commands and their arguments as they are executed (via 'set -x') like

rear -d -D mkbackup

Afterwards inspect the rear log file for further analysis.
The rear log files get stored in the /var/log/rear/ directory.

At least post here an excerpt of the rear debug log file
with some lines before the error message appears.
Try to imagine how many lines before the error message
seem to be related to the error.

The relevant code in backup/NETFS/default/50_make_backup.sh
seems to be

   127          (tar)
   128                  while sleep 1 ; kill -0 $BackupPID 2>&8; do
   129                          #blocks="$(stat -c %b ${backuparchive})"
   130                          #size="$((blocks*512))"
   131                          size="$(stat -c %s ${backuparchive}* | awk '{s+=$1} END {print s}')"
   132                          #echo -en "\e[2K\rArchived $((size/1024/1024)) MiB [avg $((size/1024/(SECONDS-starttime))) KiB/sec]"
   133                          ProgressInfo "Archived $((size/1024/1024)) MiB [avg $((size/1024/(SECONDS-starttime))) KiB/sec]"
   134                  done
   135                  ;;

I guess something with "stat -c" might not work in your case
as expected?

Perhaps you can adapt that code so that it also works
in your case.

gdha commented at 2016-05-17 14:54:

@alxndr13 The problem might be that Elementary OS is not yet a known OS within rear. Try rear dump to see more details. I believe it is based on Ubuntu, no?

jsmeix commented at 2016-09-21 13:35:

No feedback since 4 month => closing.
If needed it can be reopened.

apapierz commented at 2017-02-27 14:42:

I had similar issue in Debian 5.0. The reason was the way how awk prints numbers above 2G which is reported within ProgerssInfo function. You will get the error as mentionned only if your backup i larger than 2GB.

In Debian 5.0:
stat -c %s backup.tar.gz |awk '{s+=$1} END {print s}' 3,29123e+09

The same file in Debian 7.0 is:
stat -c %s backup.tar.gz |awk '{s+=$1} END {print s}' 3291226398

Simply change line 131 in /usr/share/rear/backup/NETFS/default/50_make_backup.sh from

size="$(stat -c %s ${backuparchive}* | awk '{s+=$1} END {print s}')"


size="$(stat -c %s ${backuparchive}* | awk '{s=$1} END {print s}')"
size="$(stat -c %s ${backuparchive}* | awk '{s+=$1} END {printf "%d\n",s}')"

It solved my problem.


[Export of Github issue for rear/rear.]