storeBackupMount.pl

storeBackupMount.pl gives you a ``script'' to mount the needed directories for the backup, start storeBackup.pl and umount the directories. Before trying to mount, it can check via ping if a server is reachable. If these directories are always (or already) mounted, there is no need to use storeBackupMount.pl.

It also can run other programs like storeBackupUpdateBackup.pl or storeBackupDel.pl.

There are different ways to use storeBackupMount.pl:

        storeBackupMount.pl --help
or
        storeBackupMount.pl -g configFile
or
        storeBackupMount.pl -f configFile
or
        storeBackupMount.pl [-s servers] [-d] [-l logFile
               [--suppressTime] [-m maxFilelen]
               [[-n noOfOldFiles] | [--saveLogs]]
               [--compressWith compressprog]]
            [--storeBackup storeBackup-Params]
            [--storeBackupUpdateBackup storeBackupUpdateBackup-Params]
            [--storeBackupCheckBackup storeBackupCheckBackup-Params]
            [--storeBackupCheckSource storeBackupCheckSource-Params]
            [--storeBackupDel storeBackupDel-Params]
            [--printAndStop] [-k killTime] [-T tmpdir] [mountPoints...]

You can generate a configuration file (option -g), use a configuration file (option -f) or use it by making your settings via command line.

To be able to mount the directories, you need an entry in /etc/fstab like the following ones:

/dev/sda5		/add		reiserfs	noatime		0 1
lotte:/disk1 /backup nfs rsize=8192,wsize=8192,user,exec,async,noatime 1 1

The first mount point /add is on a local device. In this example, it's the device with a file system to be saved. The second one (/backup) is located on /disk1 on the nfs server lotte. The rest are nfs parameters - see section 7.10 about the configuration of nfs.
If you have this kind of entries in /etc/fstab, you can mount the file systems with:
mount /add
mount /backup
and that's exactly what storeBackupMount.pl does.

There is one major difference in using the command line or the configuration file to set the options to your needs: As you can define the start of multiple storeBackup related programs, you also have to define the order in which they have to be started. You have to do this:

storeBackupMount.pl will stop execution if a program started by it does not start successfully.

You can set the following options:

--help
Print options and stop processing.
--printAndStop
Print a summary of the command line options.
--generate / -g
Specify the name of the configuration file to be generated. This option is available on the command line only.
--file / -f
Specify the name of the configuration file to be used. This option is available on the command line only.
--servers / -s / servers
List of servers (name or ip address) to be checked via ping. This option can be repeated multiple times on the command line.
--debug / -d
Generate some extra messages.
--logFile / -l
Log file for this process, default is stdout.
--suppressTime / suppressTime
Suppress the output of the actual time in the log file.
--maxFilelen / -m / maxFilelen
Maximal size of a log file. After reaching this size, the log file will be rotated (see option noOfOldFiles) or compressed (see option saveLogs).
--noOfOldFiles / -n / noOfOldFiles
Number of old rotated log files, default is 5. With default values, it will look like this:

$ ls -l /tmp/storebackup.log*
-rw------- 1 hjc  root  328815 30. Aug 12:12 /tmp/storebackup.log
-rw------- 1 root root 1000087 27. Aug 21:18 /tmp/storebackup.log.1
-rw------- 1 root root 1000038 20. Aug 19:02 /tmp/storebackup.log.2
-rw------- 1 root root 1000094 11. Aug 18:51 /tmp/storebackup.log.3
-rw------- 1 root root 1000147 11. Aug 18:49 /tmp/storebackup.log.4
-rw------- 1 root root 1000030 11. Aug 18:49 /tmp/storebackup.log.5

Older log files than *.5 have been deleted automatically.

--saveLogs / saveLogs
Save the log files with a time and date stamp instead of deleting them after rotating. (Setting this option deactivates option noOfOldFiles.)
--compressWith / compressWith
Specifies the program to compress the saved log files (e.g., with gzip -9). Default value is bzip2.
On the command line, the parameter to this option is parsed like a line in the configuration file and normally has to be quoted on the command line.
--storeBackup / storeBackup
Defines that storeBackup.pl has to be started and specifies the options/parameters for it. To be able to map this one parameter to multiples for storeBackup.pl, the quotes on the command line are stripped and you parameter to this option is parsed again.
Example: you set "-f /backup/stbu.conf" on the command line, then storeBackup.pl will be called with the two parameters -f and /backup/stbu.conf.
If you use the configuration file, simply set:
storeBackup = -f /backup/stbu.conf
to get the same result. If this all sounds strange to you, should read chapter configuration file and command line.
--storeBackupUpdateBackup / storeBackupUpdateBackup
Defines storeBackupUpdateBackup.pl to be called and set its parameters. See option --storeBackup for details.
--storeBackupCheckBackup / storeBackupCheckBackup
Defines storeBackupCheckBackup.pl to be called and set its parameters. See option --storeBackup for details.
--storeBackupCheckSource / storeBackupCheckSource
Defines storeBackupCheckSource.pl to be called and set its parameters. See option --storeBackup for details.
--storeBackupDel / storeBackupDel
Defines storeBackupDel.pl to be called and set its parameters. See option --storeBackup for details.
--killTime / -k / killTime
Time until any of the started programs will be killed. This means each individual program can run up to killTime. The format of this option is dhms, e.g. 10d4h means 10 days and 4 hours. See the keep* options of storeBackup.pl for further examples. The default value is 365 days.
--tmpdir / -T /tmpdir
Directory for temporary files, the default value is picked from the environment variable $TMPDIR. If it does not exist, /tmp is set as the default value.
...mountPoints... / mountPoints
On the command line, this is not an option; it is a list parameter. So you have to write e.g.:

# storeBackupMount.pl <all_options> /backupDisk /otherDisk

In the configuration file this is similar to:
mountPoints = /backupDisk /otherDisk
Here you specify the list of mount points needed to perform the backup. This must be a list of paths which have to be defined in /etc/fstab. If you add ro or rw to the beginning of a mount point, you can overwrite that option in /etc/fstab. Example:

ro,/fileSystemToRead

will mount /fileSystemToRead read only, even if the corresponding entry in /etc/fstab is read/write. But only root is allowed to use this feature!

Heinz-Josef Claes 2014-04-20