dumpnet.host.userdefined.cmd - run a single userdefined command on the target host (or locally)
- BACKUP MODE
-
dumpnet.host.userdefined.cmd [-N] [-L] [-c COMPRESSION] [-p POSTFIX] [-a RUN_AFTER] [-b RUN_BEFORE] [-l LEVEL] [-s SESSIONID] [-d DUMPNET_CONFIG] HOST_CONFIG DIRNAME COMMAND
- RESOTRE MODE
-
dumpnet.host.userdefined.cmd -R [-v] [-f FILE] [-d DUMPNET_CONFIG] HOST_CONFIG DIRNAME COMMAND
dumpnet.host.userdefined.cmd runs COMMAND and saves its output in the directory specified by DIRNAME. It gets called by dumpnet.host.userdefined, dumpnet.host.diff.cmd, dumpnet.host.fstab.dump and dumpnet.host.fstab.tar to do the dirty work.
If you already have an entry for the command to run in a dumpnet.userdefined.conf file it is recommended to call dumpnet.host.userdefined and grep the specific line you need into it. Please see the EXAMPLES section in dumpnet.host.userdefined(8).
- BACKUP MODE
- -N
-
Do not update dumpnet.cmddates. This is useful for an irregular backup. Keep in mind that a backup created with the -N switch will not be listed in restore mode. See dumpnet.cmddates(8).
- -L
-
Run COMMAND locally. You can have the same effect by prefixing COMMAND with an `@' sign.
- -A
-
Create a log entry with the priority ERRO and exit immedeatly if RUN_AFTER fails.
- -B
-
Create a log entry with the priority ERRO and exit immedeatly if RUN_BEFORE fails.
- -c COMPRESSION
-
Compression of the archive: ``remote'', ``local'' or ``none''.
- remote
-
Does the compression on the target host before transferring the data. This requires more CPU-resources on the target host but is fastest on slow connections. It is recommended for use over the Internet.
- local
-
Does the compression on the backup machine after transferring the data. This is easyier to handle for the target host but requires a fast connection and a lot of CPU-power on the backup machine.
- none
-
Does no compression at all. Choose this option if the data is already compressed or if you always need it to be available in uncrompressed form for some reason.
- -p POSTFIX
-
A postfix (a file extension in most cases) to append to the name of the file in which the output is stored.
- -a RUN_AFTER
-
The command to run after COMMAND was successfully executed. The command runs in the context of the script itself. Before it gets executed, dumpnet.host.userdefined.cmd changes into the directory where the destination file is stored. By default only a log entry with the priority WARN will be created if run_after fails. To make dumpnet.host.userdefined.cmd create a log entry with the priority ERRO and exit immedeatly, prefix the command with an exclamation mark (`!') - this has the same effect as using the -A option. For details please see dumpnet.userdefined.conf(8).
- -b RUN_BEFORE
-
The command to run before COMMAND gets executed. The command runs in the context of the script itself. Before it gets executed, dumpnet.host.userdefined.cmd changes into the directory where the destination file is stored. By default only a log entry with the priority WARN will be created if run_before fails. To make dumpnet.host.userdefined.cmd create a log entry with the priority ERRO and exit immedeatly, prefix the command with an exclamation mark (`!') - this has the same effect as using the -B option. For details please see dumpnet.userdefined.conf(8).
- -D CMDDATES_CMD
-
The command to write to the cmddates file. Use this option if you want different COMMANDs be treated as one. It is used in this way by dumpnet.host.fstab.rsync(8).
- -l LEVEL
-
Set level to LEVEL. This can be a numerical level (0-9) or a level mode. See the sections LEVELS and LEVEL MODES in dumpnet(8) for details.
- -s SESSIONID
-
Set sessionId to SESSIONID. If you don't know if you need this option, you don't! Read the SESSIONID section in dumpnet(8) before using it!
- -d DUMPNET_CONFIG
-
Use DUMPNET_CONFIG instead of the default $DUMPNET_HOME/conf/dumpnet.conf.
- HOST_CONFIG
-
The host configuration file. For the target host 192.168.1.10 it could be conf/192.168.1.10/dumpnet.HOST.conf.
- DIRNAME
-
The name of the sub-directory where the output file is to be stored: $backupDir/$host/$dirname.
- COMMAND
-
The command to execute. If prefixed by an `@' sign it will be run locally. For the special variables you can use in this command to make incremental backups, please see dumpnet.userdefined.conf(8). You need to take special care if COMMAND actually consists of multiple commands separated by pipes (`|'). You will have to use the COMMAND_RETURN_CODE feature documented in dumpnet.userdefined.conf(8). If the remote shell is not bash no single quotes can be used within COMMAND.
- RESTORE MODE
- -R
-
Restore mode. This will not actually do the restore but will list the files you will need to perform it manually.
- -v
-
Be verbose.
- -f FILE
-
Find the files that are needed to restore FILE. FILE will be used as a pattern to grep in the TOC-files.
- -d DUMPNET_CONFIG
-
Use DUMPNET_CONFIG instead of the default $DUMPNET_HOME/conf/dumpnet.conf.
- HOST_CONFIG
-
The host configuration file. For the target host 192.168.1.10 it could be conf/192.168.1.10/dumpnet.HOST.conf.
- DIRNAME
-
The name of the sub-directory where the output files are stored: $backupDir/$host/$dirname.
- COMMAND
-
Restore the backups that were created by running COMMAND. If you created the backup by running dumpnet.host.userdefined.cmd with the -D option, use as COMMAND whatever you passed to the -D option.
Do a backup of the filesystem 192.168.1.10:/usr and save it in /$backupDir/$host/usr.
dumpnet.host.userdefined.cmd conf/192.168.1.10/dumpnet.HOST.conf usr '/sbin/dump -$level -f - /usr'
Do a backup of 192.168.1.11:/ compress it remotly and save it in $backupDir/$host/ROOT/
dumpnet.host.userdefined.cmd -c remote conf/192.168.1.10/dumpnet.HOST.conf ROOT '/sbin/dump -$level -f - /'
Like the previous but force the use of level 0, generate a TOC and do not update dumpnet.cmddates:
dumpnet.host.userdefined.cmd -Nc remote -a 'gunzip -c $dest | $local_restore -tf - > $dest.toc' conf/192.168.1.10/dumpnet.HOST.conf ROOT '/sbin/dump -$level -f - /'
List the files I need to restore 192.168.1.10:/usr (archives stored in the subdir usr)
dumpnet.host.userdefined.cmd -R /usr conf/192.168.1.10/dumpnet.HOST.conf usr '/sbin/dump -$level -f - /usr'
Find the backup of 192.168.1.10:/home (stored in the sub-dir home) I need to restore /home/jdoe/somefile.txt.
dumpnet.host.userdefined.cmd -Rf home/jdoe/somefile.txt /home conf/192.168.1.10/dumpnet.HOST.conf home '/sbin/dump -$level -f - /'
dumpnet.host.userdefined.cmd will return a zero exit status if COMMAND exits with 0. In any other case it will return 1.
dumpnet(8)
dumpnet.host(8)
dumpnet.host.userdefined(8)
Lukas Feiler <lukas.feiler@lukasfeiler.com>
dumpnet is published under the LGPL (GNU LESSER GENERAL PUBLIC LICENSE). Please see the LICENSE file contained in the installation tarball for details. The official web site is http://dumpnet.sourceforge.net.