Data backups under Linux are easily and efficiently created with rdiff-backup . The tool written in Python also creates statistics for each backup pass and stores them in their own files. The following article explains what the values of the statistics mean and what values you must be aware of.

 

print statistics

As mentioned earlier, rdiff-backup keeps statistics about the backup performed for each backup run. When performing a backup on the command line, when using –print-statistics, the statistics are also displayed on the standard output after the backup is created:

$ rdiff-backup --print-statistics tktest@192.168.56.105 :: / etc backup /
-------------- [Session statistics] --------------
StartTime 1425979918.00 (Tue Mar 10 10:31:58 2015)
EndTime 1425979924.45 (Tue Mar 10 10:32:04 2015)
ElapsedTime 6.45 (6.45 seconds)
SourceFiles 2027
SourceFileSize 107084861 (102 MB)
MirrorFiles 2025
MirrorFileSize 2227261 (2.12 MB)
NewFiles 2
NewFileSize 104857600 (100 MB)
DeletedFiles 0
DeletedFileSize 0 (0 bytes)
ChangedFiles 3
ChangedSourceSize 0 (0 bytes)
ChangedMirrorSize 0 (0 bytes)
IncrementFiles 5
IncrementFileSize 66 (66 bytes)
TotalDestinationSizeChange 104857666 (100 MB)
Errors 0
--------------------------------------------------

Regardless of the –print-statistics options, session_statistics files are created after each backup run :

$ ls backup / rdiff-backup-data / session_statistics *
backup / rdiff-backup-data / session_statistics.2015-03-09T13: 15: 58 + 01: 00.data
backup / rdiff-backup-data / session_statistics.2015-03-09T13: 57: 08 + 01: 00.data
backup / rdiff-backup-data / session_statistics.2015-03-09T13: 57: 56 + 01: 00.data

Behind the statistics values are the following information: [1]

value importance
start Time Start time of the backup
EndTime End time of the backup
elapsedTime Runtime (end time – start time)
source files Number of files in the source directory (the one to be backed up)
Source File Size Size of the files in the source directory
Mirror files Number of files in the mirror directory (where to back up)
Mirror File Size Size of the files in the mirror directory
NewFiles Number of files in Source that are not yet in Mirror (new files to back up)
NewFileSize Size of new files in Source, but not yet in Mirror
deleted files Number of files in Mirror that are no longer in Source (files to remove)
Deleted File Size Size of the files in Mirror, but not in Source anymore
ChangedFiles Number of files present in Source and Mirror that have changed since last backup
ChangedSourceSize Size of changed files in Source
ChangedMirrorSize Size of changed files in Mirror
IncrementFiles Number of increment files to create in rdiff-backup-data – Increments are created for new, removed, and changed files
IncrementFileSize Size of increment files to create
Total Size Change Destination Size increase of mirror including rdiff-backup-data directory
Errors Number of errors occurred

rdiff-backup-statistics

rdiff-backup-statistics is a command-line tool that creates summaries of session_statistics files. These statistics are helpful if the backup directory grows for unknown reasons. When analyzing which files caused the increase, rdiff-backup-statistics is helpful:

  • If it is a new file, look for Top directories by source size
  • If it is a file that has changed a lot, look for Top directories by increment size
  • For a directory where a lot of files have changed, look for Top directories by number of files changed

rdiff-backup-statistics also supports the restriction to periods, so you only get statistics about the last month or the last day:

$ rdiff-backup-statistics --begin-time 1M backup /
$ rdiff-backup-statistics --begin-time 1D backup /

rdiff-backup-statistics then ignores those sessions_statistics that are older than 1 month or 1 day. Which time formats are supported can be found man rdiff-backupunder the section TIME FORMATS.

Attention: The values under Average always show the average over all session statistics.

$ rdiff-backup-statistics backup /
Processing statistics from session 1 of 5
Processing statistics from session 2 of 5
Processing statistics from session 3 of 5
Processing statistics from session 4 of 5
Processing statistics from session 5 of 5
Session statistics:
-------------- [Average of 5 stat files] --------------
ElapsedTime 5.92 (5.92 seconds)
SourceFiles 2025.8
SourceFileSize 48364605.0 (46.1 MB)
MirrorFiles 1620.6
MirrorFileSize 22753328.8 (21.7 MB)
NewFiles 405.2
NewFileSize 21416972.2 (20.4 MB)
DeletedFiles 0.0
DeletedFileSize 0.0 (0 bytes)
ChangedFiles 3.0
ChangedSourceSize 25165824.0 (24.0 MB)
ChangedMirrorSize 20971520.0 (20.0 MB)
IncrementFiles 3.2
IncrementFileSize 22924.0 (22.4 KB)
TotalDestinationSizeChange 25634200.2 (24.4 MB)
Errors 0
-------------------------------------------------- -----
Top directories by source size (percent of total)
-------------------------------------------------
dump / data-dump (95.4%)

Top directories by increment size (percent of total)
-------------------------------------------------- -
dump / data-dump (99.8%)

Top directories by number of files changed (percent of total)
-------------------------------------------------- -----------
, (75.7%)
ssl / certs (24.3%)
Categories: Knowledgebase

0 Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: