Peter
Peter

Reputation: 379

RSnapshot reports errors using rsnapreport.pl: "NO STATS DATA"

I configured RSnapshot on a WD My Book Live (2TB) and its working (at least that's what the logs say). I used the reporting tool rsnapreport.pl from /usr/share/doc/rsnapshot/examples/utils/rsnapreport.pl.gz to get human readable mail reports about the crontab triggered backup jobs.

While the backup jobs seem to work, the reports are a obviously missing information as you can see in this snipplet:

SOURCE                          TOTAL FILES   FILES TRANS      TOTAL MB     MB TRANS   LIST GEN TIME  FILE XFER TIME
--------------------------------------------------------------------------------------------------------------------
rsync://server:/vmail                 13950           137       3687.81        20.31   0.052 seconds   0.000 seconds

ERRORS
/shares/rsnapshot/daily.0/ NO STATS DATA

The Question now is:

Beside the error at the bottom, which is my first and major problem and question, the FILE XFER TIME is also 0 for all backup jobs (I guess that the issues correlate).

I followed all instructions (see below) - what am I missing?

So what did I do so far:

*) The NAS runs Debian Squeeze (incl. squeeze-backports), Kernel Version is 2.6.32, PPC Architecture.

*) rsync version 3.0.3-2 (preinstalled), with /etc/rsyncd.conf:

pid file=/var/run/rsyncd.pid
lock file=/var/run/rsync.lock
log file=/var/log/rsync.log

[rsync]
path=/shares/rsync
uid=root
gid=share
read only=no
list=yes
auth users=root

*) Installed rsnapshot 1.3.1-1 with /etc/rsnapshot.conf:

config_version  1.2
snapshot_root   /shares/rsnapshot/
cmd_rm          /bin/rm
cmd_rsync       /usr/bin/rsync
cmd_logger      /usr/bin/logger
interval        daily   7
interval        weekly  4
interval        monthly 3
verbose         3
loglevel        3
logfile         /var/log/rsnapshot.log
lockfile        /var/run/rsnapshot.pid
rsync_long_args --delete --numeric-ids --relative --delete-excluded --stats
backup  rsync://server:/vmail/     backupOfServer/vmail/
backup  ...
backup  ...
backup  ...

*) unpacked the report script and followed instructions in the script (most of which you can see in the config above):

# this script prints a pretty report from rsnapshot output
# in the rsnapshot.conf you must set
# verbose >= 3
# and add --stats to rsync_long_args
# then setup crontab 'rsnapshot daily 2>&1 | rsnapreport.pl | mail -s"SUBJECT" [email protected]
# don't forget the 2>&1 or your errors will be lost to stderr

*) and set up cron.d/rsnapshot:

MAILTO="user1@foo,user2@foo"

30 3    * * *           root    /usr/bin/rsnapshot daily 2>&1 | /root/rsnapreport.pl
0  3    * * 1           root    /usr/bin/rsnapshot weekly 2>&1 | /root/rsnapreport.pl
30 2    1 * *           root    /usr/bin/rsnapshot monthly 2>&1 | /root/rsnapreport.pl

If you need any detailed or additional information, don't hesitate. We are happy to have daily reports of the backup at all, just the errors at the bottom are making us nervous.

Best Regards and thanks in advance,

Peter

Upvotes: 0

Views: 5394

Answers (3)

Tsounabe
Tsounabe

Reputation: 2184

The "NO STATS DATA" error is also reported if you backing up something containing "rsync" in its path like /etc/default/rsync.

For example in this case the command rsnapshot daily 2>&1 | /bu/script/rsnapreport.pl | mail -s "[BU Report]date" [email protected] will return the following errors:

Use of uninitialized value $source in hash element at /bu/script/rsnapreport.pl line 95, <> line 3991. Use of uninitialized value $source in hash element at /bu/script/rsnapreport.pl line 96, <> line 3991. ...

This is due to the rsnapreport.pl script which parse stats info from the rsync outpout and from the "rsync" string in it.

To simply resolve this problem add in your /etc/rsnapshot.conf the line corresponding to the problematic rsync string found in the rsync outpout:

For example and if you don't need to backup etc/default/rsync:

exclude         etc/default/rsync

If you need to backup the files with path containing "rsync" you have to modify the rsnapreport.pl script.

Upvotes: 0

norrland
norrland

Reputation: 1

The "NO STATS DATA" error is also reported if you miss out on the:

    rsync_long_args --stats

Upvotes: 0

Peter
Peter

Reputation: 379

The reason for this error was, that I did not uncomment the cmd_cp parameter. RSnapshot therefore used its build-in copy mechanism, which uses rsync.

This call of rsync was echoed to the output. The report script scans the output for calls to rsync and looks for transfer statistics, but the initial "copy" command does not produce such stats - therefore the error saying "NO STATS" for the source /daily.0

The solution is, to read the configuration file and follow the instructions:

# LINUX USERS:   Be sure to uncomment "cmd_cp". This gives you extra features.
# EVERYONE ELSE: Leave "cmd_cp" commented out for compatibility.
#
# See the README file or the man page for more details.
#
#cmd_cp          /bin/cp

Uncommenting the last line fixes the error... RTFM ;)

Upvotes: 1

Related Questions