NAME
storeBackup.pl - fancy compressing managing checksumming hard-linking cp -ua
DESCRIPTION
This program copies trees to another location. Every file copied is potentially compressed (see --exceptSuffix). The backups after the first backup will compare the files with an md5 checksum with the last stored version. If they are equal, it will only make an hard link to it. It will also check mtime, ctime and size to recognize idential files in older backups very fast. It can also backup big image files fast and efficiently on a per block basis (data deduplication).
You can overwrite options in the configuration file on the command line.
SYNOPSIS
$prog --helpor$prog -g configFileor$prog [-f configFile] [-s sourceDir][-b backupDirectory] [-S series] [--print][-T tmpdir] [-L lockFile] [--unlockBeforeDel][--exceptDirs dir1,dir2,dir3] [--contExceptDirsErr][--includeDirs dir1,dir2,dir3][--exceptRule rule] [--includeRule rule][--exceptTypes types] [--cpIsGnu] [--linkSymlinks][--precommand job] [--postcommand job][--followLinks depth] [--highLatency][--ignorePerms] [--lateLinks [--lateCompress]][--checkBlocksSuffix suffix] [--checkBlocksMinSize size][--checkBlocksBS][--checkBlocksRule0 rule [--checkBlocksBS0 size][--checkBlocksCompr0] [--checkBlocksRead0 filter][--checkBlocksParallel0]][--checkBlocksRule1 rule [--checkBlocksBS1 size][--checkBlocksCompr1] [--checkBlocksRead1 filter][--checkBlocksParallel1]][--checkBlocksRule2 rule [--checkBlocksBS2 size][--checkBlocksCompr2] [--checkBlocksRead2 filter][--checkBlocksParallel2]][--checkBlocksRule3 rule [--checkBlocksBS3 size][--checkBlocksCompr3] [--checkBlocksRead3 filter][--checkBlocksParallel3]][--checkBlocksRule4 rule [--checkBlocksBS4 size][--checkBlocksCompr4] [--checkBlocksRead4 filter][--checkBlocksParallel4]][--checkDevices0 list [--checkDevicesDir0][--checkDevicesBS0] [checkDevicesCompr0][--checkDevicesParallel0]][--checkDevices1 list [--checkDevicesDir1][--checkDevicesBS1] [checkDevicesCompr1][--checkDevicesParallel1]][--checkDevices2 list [--checkDevicesDir2][--checkDevicesBS2] [checkDevicesCompr2][--checkDevicesParallel2]][--checkDevices3 list [--checkDevicesDir3][--checkDevicesBS3] [checkDevicesCompr3][--checkDevicesParallel3]][--checkDevices4 list [--checkDevicesDir4][--checkDevicesBS4] [checkDevicesCompr4][--checkDevicesParallel1]][--saveRAM] [-c compress] [-u uncompress] [-p postfix][--noCompress number] [--queueCompress number][--noCopy number] [--queueCopy number][--withUserGroupStat] [--userGroupStatFile filename][--exceptSuffix suffixes] [--addExceptSuffix suffixes][--minCompressSize size] [--comprRule][--doNotCompressMD5File] [--chmodMD5File] [-v][-d level][--progressReport number] [--printDepth][--ignoreReadError][--suppressWarning key] [--linkToRecent name][--doNotDelete] [--deleteNotFinishedDirs][--resetAtime] [--keepAll timePeriod] [--keepWeekday entry][[--keepFirstOfYear] [--keepLastOfYear][--keepFirstOfMonth] [--keepLastOfMonth][--firstDayOfWeek day] [--keepFirstOfWeek][--keepLastOfWeek] [--keepDuplicate] [--keepMinNumber][--keepMaxNumber]| [--keepRelative] ][-l logFile[--plusLogStdout] [--suppressTime] [-m maxFilelen][[-n noOfOldFiles] | [--saveLogs]][--compressWith compressprog]][--logInBackupDir [--compressLogInBackupDir][--logInBackupDirFileName logFile]][otherBackupSeries ...]
OPTIONS
- --help
-
show this help
- --generate, -g
-
generate a template of the configuration file
-
print configuration read from configuration fileor command line and stop
- --file, -f
-
configuration file (instead of or additionally to optionson command line)
- --sourceDir, -s
-
source directory (must exist)
- --backupDir, -b
-
top level directory of all backups (must exist)
- --series, -S
-
series directory, default is 'default'relative path from backupDir
- --tmpdir, -T
-
directory for temporary files, default is </tmp>
- --lockFile, -L
-
lock file, if exists, new instances will finish if an oldis already running, default is $lockFile
- --unlockBeforeDel
-
remove the lock file before deleting old backupsdefault is to delete the lock file after removing oldbackups
- --exceptDirs, -e
-
directories to except from backing up (relative path),wildcards are possible and should be quoted to avoidreplacements by the shelluse this parameter multiple times for multipledirectories
- --contExceptDirsErr
-
continue if one or more of the exceptional directoriesdo not exist (default is to stop processing)
- --includeDirs, -i
-
directories to include in the backup (relative path),wildcards are possible and have to be quoteduse this parameter multiple times for multiple directories
- --exceptRule
-
Files to exclude from backing up.see README: 'including / excluding files and directories'
- --includeRule
-
Files to include in the backug up - like exceptRulesee README: 'including / excluding files and directories'
- --writeExcludeLog
-
write a file name .storeBackup.notSaved.bz2 with the namesof all skipped files
- --exceptTypes
-
do not save the specified type of files, allowed: SbcfplS - file is a socketb - file is a block special filec - file is a character special filef - file is a plain filep - file is a named pipel - file is a symbolic linkSbc can only be saved when using option [cpIsGnu]
- --cpIsGnu
-
Activate this option if your systems cp is a full-featuredGNU version. In this case you will be able to also backupseveral special file types like sockets.
- --linkSymlinks
-
hard link identical symlinks
- --precommand
-
exec job before starting the backup, checks lockFile (-L)before starting (e.g. can be used for rsync)stops execution if job returns exit status != 0This parameter is parsed like a line in the configurationfile and normally has to be quoted.
- --postcommand
-
exec job after finishing the backup, but before erasing ofold backups reports if job returns exit status != 0This parameter is parsed like a line in the configurationfile and normally has to be quoted.
- --followLinks
-
follow symbolic links like directories up to depthdefault = 0 -> do not follow links
- --highLatency
-
use this for a very high latency line (eg. vpn overthe internet) for better parallelization
- --ignorePerms
-
If this option chosen, files will not necessarily havethe same permissions and owner as the originals. Thisspeeds up backups on network drives a lot. Recovery withstoreBackupRecover.pl will restore them correctly.
- --lateLinks
-
do *not* write hard links to existing files in the backupduring the backupyou have to call the program storeBackupWriteLateLink.pllater on your server if you set this flag to 'yes'you have to run storeBackupUpdateBackup.pl later - seedescription for that program
- --lateCompress
-
only in combination with --lateLinkscompression from files >= minCompressSize will be donelater, the file is (temporarily) copied into the backup
- --checkBlocksSuffix
-
Files with suffix for which storeBackup will make an md5check on blocks of that file. Executed after--checkBlocksRule(n)This option can be repeated multiple times
- --checkBlocksMinSize
-
Only check files specified in --checkBlocksSuffix if therefile size is at least this value, default is 100M
- --checkBlocksBS
-
Block size for files specified with --checkBlocksSuffixDefault is $checkBlocksBSdefault (1 megabyte)
- --checkBlocksCompr
-
if set, the blocks generated due to checkBlocksSuffixare compressed
- --checkBlocksRule0
-
Files for which storeBackup will make an md5 checkdepending on blocks of that file.
- --checkBlocksBS0
-
Block size for option checkBlocksRuleDefault is $checkBlocksBSdefault (1 megabyte)
- --checkBlocksCompr0
-
if set, the blocks generated due to this rule arecompressed
- --checkBlocksRead0
-
Filter for reading the file to treat as a blocked fileeg. 'gzip -d' if the file is compressed. Default is noread filter.This parameter is parsed like the line in theconfiguration file and normally has to be quoted,eg. 'gzip -9'
- --checkBlocksParallel0
-
Read files specified here in parallel to "normal" ones.This only makes sense if they are on a different disk.Default value is 'no'
- --checkBlocksRule1
- --checkBlocksBS1
- --checkBlocksCompr1
- --checkBlocksRead1
- --checkBlocksParallel1
- --checkBlocksRule2
- --checkBlocksBS2
- --checkBlocksCompr2
- --checkBlocksRead2
- --checkBlocksParallel2
- --checkBlocksRule3
- --checkBlocksBS3
- --checkBlocksCompr3
- --checkBlocksRead3
- --checkBlocksParallel3
- --checkBlocksRule4
- --checkBlocksBS4
- --checkBlocksCompr4
- --checkBlocksRead4
- --checkBlocksParallel4
- --checkDevices0
-
List of devices for md5 ckeck depending on blocks of thesedevices
- --checkDevicesDir0
-
Directory where to store the backup of the device
- --checkDevicesBS0
-
Block size of option checkDevices0,default is 1M (1 megabyte)
- --checkDevicesCompr0
-
Compress blocks resulting from option checkDevices0
- --checkDevicesParallel0
-
Read devices specified in parallel to the rest of thebackup. This only makes sense if they are on a differentdisk. Default value is 'no'
- --checkDevices1
- --checkDevicesDir1
- --checkDevicesBS1
- --checkDevicesCompr1
- --checkDevicesParallel1
- --checkDevices2
- --checkDevicesDir2
- --checkDevicesBS2
- --checkDevicesCompr2
- --checkDevicesParallel2
- --checkDevices3
- --checkDevicesDir3
- --checkDevicesBS3
- --checkDevicesCompr3
- --checkDevicesParallel3
- --checkDevices4
- --checkDevicesDir4
- --checkDevicesBS4
- --checkDevicesCompr4
- --checkDevicesParallel4
- --saveRAM
-
write temporary dbm files in --tmpdiruse this if you do not have enough RAM
- --compress, -c
-
compress command (with options), default is <bzip2>This parameter is parsed like the line in theconfiguration file and normally has to be quoted,eg. 'gzip -9'
- --uncompress, -u
-
uncompress command (with options), default is <bzip2 -d>This parameter is parsed like the line in theconfiguration file and normally has to be quoted, eg.'gzip -d'
- --postfix, -p
-
postfix to add after compression, default is <.bz2>
- --exceptSuffix
-
do not compress files with the followingsuffix (uppercase included):('\.zip', '\.bz2', '\.gz', '\.tgz', '\.jpg', '\.gif','\.tiff', '\.tif', '\.mpeg', '\.mpg', '\.mp3', '\.ogg','\.gpg', '\.png')This option can be repeated multiple timesIf you do not want any compression, set this optionto '.*'
- --addExceptSuffix
-
like --exceptSuffix, but do not replace defaults, add
- --minCompressSize
-
Files smaller than this size will never be compressedbut copied
- --comprRule
-
alternative to --exceptSuffix and minCompressSize:definition of a rule which files will be compressed
- --noCompress
-
maximal number of parallel compress operations,default = chosen automatically
- --queueCompress
-
length of queue to store files before compression,default = 1000
- --noCopy
-
maximal number of parallel copy operations,default = 1
- --queueCopy
-
length of queue to store files before copying,default = 1000
- --withUserGroupStat
-
write statistics about used space in log file
- --userGroupStatFile
-
write statistics about used space in name filewill be overridden each time
- --doNotCompressMD5File
-
do not compress .md5CheckSumFile
- --chmodMD5File
-
permissions of .md5CheckSumFile and corresponding.storeBackupLinks directory, default is 0600
- --verbose, -v
-
verbose messages
- --debug, -d
-
generate debug messages, levels are 0 (none, default),1 (some), 2 (many) messages, especially in--exceptRule and --includeRule
- --resetAtime
-
reset access time in the source directory - but this willchange ctime (time of last modification of file statusinformation)
- --doNotDelete
-
check only, do not delete any backup
- --deleteNotFinishedDirs
-
delete old backups which have not been finishedthis will not happen if doNotDelete is set
- --keepAll
-
keep backups which are not older than the specified amountof time. This is like a default value for all days in--keepWeekday. Begins deleting at the end of the scriptthe time range has to be specified in format 'dhms', e.g.10d4h means 10 days and 4 hoursdefault = 20d
- --keepWeekday
-
keep backups for the specified days for the specifiedamount of time. Overwrites the default values chosen in--keepAll. 'Mon,Wed:40d Sat:60d10m' means:keep backups from Mon and Wed 40days + 5minskeep backups from Sat 60days + 10minskeep backups from the rest of the days like spcified in--keepAll (default $keepAll)if you also use the 'archive flag' it means to notdelete the affected directories via --keepMaxNumber:a10d4h means 10 days and 4 hours and 'archive flag'e.g. 'Mon,Wed:a40d5m Sat:60d10m' means:keep backups from Mon and Wed 40days + 5mins + 'archive'keep backups from Sat 60days + 10minskeep backups from the rest of the days like specified in--keepAll (default 30d)
- --keepFirstOfYear
-
do not delete the first backup of a yearformat is timePeriod with possible 'archive flag'
- --keepLastOfYear
-
do not delete the last backup of a yearformat is timePeriod with possible 'archive flag'
- --keepFirstOfMonth
-
do not delete the first backup of a monthformat is timePeriod with possible 'archive flag'
- --keepLastOfMonth
-
do not delete the last backup of a monthformat is timePeriod with possible 'archive flag'
- --firstDayOfWeek
-
default: 'Sun'. This value is used for calculating--keepFirstOfWeek and --keepLastOfWeek
- --keepFirstOfWeek
-
do not delete the first backup of a weekformat is timePeriod with possible 'archive flag'
- --keepLastOfWeek
-
do not delete the last backup of a weekformat is timePeriod with possible 'archive flag'
- --keepDuplicate
-
keep multiple backups of one day up to timePeriodformat is timePeriod, 'archive flag' is not possibledefault = 7d
- --keepMinNumber
-
Keep that miminum of backups. Multiple backups of oneday are counted as one backup. Default is 10.
- --keepMaxNumber
-
Try to keep only that maximum of backups. If you have morebackups, the following sequence of deleting will happen:- delete all duplicates of a day, beginning with the oldonce, except the last of every day- if this is not enough, delete the rest of the backupsbeginning with the oldest, but *never* a backup withthe 'archive flag' or the last backup
- --keepRelative, -R
-
Alternative deletion scheme. If you use this option, allother keep options are ignored. Preserves backups dependingon their *relative* age. Example:-R '1d 7d 61d 92b'will (try to) ensure that there is always- One backup between 1 day and 7 days old- One backup between 5 days and 2 months old- One backup between ~2 months and ~3 months oldIf there is no backup for a specified timespan(e.g. because the last backup was done more than 2 weeksago) the next older backup will be used for this timespan.
- --progressReport, -P
-
print progress report after each 'number' files
- --printDepth, -D
-
print depth of actual read directory during backup
- --ignoreReadError
-
ignore read errors in source directory; not readabledirectories do not cause storeBackup.pl to stop processing
- --suppressWarning
-
suppress (unwanted) warnings in the log files;to suppress warnings, the following keys can be used:excDir (suppresses the warning that excluded directoriesdo not exist)fileChange (suppresses the warning that a file has changedduring the backup)crSeries (suppresses the warning that storeBackup had tocreate the 'default' series)hashCollision (suppresses the warning if a possiblehash collision is detected)fileNameWithLineFeed (suppresses the warning if a filenamecontains a line feed)This option can be repeated multiple times on the command line.
- --linkToRecent
-
after a successful backup, set a symbolic link tothat backup and delete existing older links with thesame name
- --logFile, -l
-
log file (default is STDOUT)
- --plusLogStdout
-
if you specify a log file with --logFile you canadditionally print the output to STDOUT with this flag
- --suppressTime
-
suppress output of time in logfile
- --maxFilelen, -m
-
maximal length of log file, default = 1e6
- --noOfOldFiles, -n
-
number of old log files, default = 5
- --saveLogs
-
save log files with date and time instead of deleting theold (with [-noOldFiles])
- --compressWith
-
compress saved log files (e.g. with 'gzip -9')default is 'bzip2'This parameter is parsed like a line in the configurationfile and normally has to be quoted.
- --logInBackupDir
-
write log file (also) in the backup directoryBe aware that this log does not contain all errormessages of the one specified with --logFile!
- --compressLogInBackupDir
-
compress the log file in the backup directory
- --logInBackupDirFileName
-
filename to use for writing the above log file,default is .storeBackup.log
- otherBackupSeries
-
List of other backup series to consider forhard linking. Relative path from backupDir!Format (examples):backupSeries/2002.08.29_08.25.28 -> consider this backupor0:backupSeries ->last (youngest) in <backupDir>/backupSeries1:backupSeries ->one before last in <backupDir>/backupSeriesn:backupSeries ->n'th before last in <backupDir>/backupSeries3-5:backupSeries ->3rd, 4th and 5th in <backupDir>/backupSeriesall:backupSeries -> all in <backupDir>/backupSeriesdefault is to link to the last backup in every series
COPYRIGHT
Copyright (c) 2000,2004,2008-2009,2012 by Heinz-Josef Claes (see README). Published under the GNU General Public License or any later version.