edrc/bin/scripts/CUSTOMER-sat/...
edrc/bin/scripts/CUSTOMER-sat/sup:Support/osup:OperationSupport/...
edrc/bin/scripts/CUSTOMER-sat/sup:Support/psup:ProductionSupport/...
CUSTOMER ::= `server_environment -C`
The newscript command provides a script file template and ensures that the recovery script name adheres to the supported name convention.
edrc maintains an environment that makes it obsolete to initialize common settings of the operating system in each script and makes a recovery script tree portable.
Candidates of commands to be executed in an environment-file created with env are for example scripttitle(3) and scriptsequence(3).
Doing this the description can be easily displayed using the doc contributed command, which generates an ah-hoc manual page where the essentials to know about a script, as if a RE-RUN of the script is allowed, the duration of the execution or an example output and more can be documented.
This documentation can be used later to produce a whole documentation, the ScriptDocBook using the scriptdocbook command that can be used for offline-reading in a Web-browser without the need to write another documentation.
Use the edrcenv(1) command in the shell started from edrc or the edrcenv contributed command in edrc to print the official environment variables that can be used.
The directory with a unique name is created new just before the start of a recovery script and is removed after the script execution.
Therefore a recovery script doesn't need to take care of the temporary directory.
This variable should be used to securely save temporary data from recovery scripts or contributed commands that must be accessed multiple times throughout the edrc session.
You should add the name of the recovery script or contributed command as prefix to ensure a unique filename.
Example:
date > $EDRC_TMP_DIR_SESSION/$EDRC_SCRIPTNAME.data
If you need to save temporary data during the execution of a recovery script or a contributed command the $EDRC_TMP_DIR variable shall be used.
# # _env - Environment settings for commands in /DR # # [00] 07.05.2020 CWa Initial Version # # test "$DEBUG" = True && set -x scripttitle scriptsequence -a query || exit export AVAMAR_ADMIN="admin" export AVAMAR_SYSADMIN="sysadmin" export CONNECTION_USER="edrc"
#!/bin/bash # # 1291:setup_ndmp - setup NDMP accelerator # # [00] 06.05.2020 CWa Initial Version # test "$DEBUG" = True && set -x # const and defaults # user_at_node=root@acme-007.acme.ch root_password="`pwsafe root@IDPA`" # query information # while [ "$ok" != "y" ]; do echo root_password=`input "Root server password" "$root_password" \ LOG_STARS,NOT_NULL,NO_TRIM` echo ok=`choice "input OK? <yn>" yn n` done echo # execute commands # ssh-exec -l $CONNECTION_USER -u $user_at_node <<EOM [COMMANDS] avsetupndmp [ANSWERS] ;avsetupndmp will stop all running agents;Y\r; ;Network address or DNS name of this Accelerator Node;\r; ;Network address or DNS name of the Avamar Server;\r; ;Root password of Avamar Server;$root_password\r; ;Repeat password;$root_password\r; ;Enable support for multiple simultaneous backups Y/N?;Y\r; ;Enter action:;5\r; EOM # D: Setup NDMP accelerator nodes: # D: # D: - setup NDMP accelerator node bkpviewbad01 # # R: YES # # O: Root server password [********]: ******** # O: # O: input OK? <yn> [n] :y # O: # O: avsetupndmp version 5.0 # O: Configure systems for backup and restore. # O: avsetupndmp will stop all running agents, do you wish to continue Y/N? [Y]: Y # O: # O: avagent Info: ------------------------------------------------------------ # O: avagent Info: Client 'acme-008-0815' in directory '/usr/local/avamar/var/acme-008-0815' # O: avagent Info: Client Agent acme-008-0815 not running. # O: avagent Info: ------------------------------------------------------------ : : # O: avagent Info: ------------------------------------------------------------ # O: # O: IMPORTANT: Be sure to run avregister if you have added new accounts. # # N: Chapter: 6.16, Step 1 # # T: ~10 seconds #
See "recovery" script examples in the sys (1) maintenance configuration located in edrc/scripts/sys/.
This is free software; see edrc/doc/COPYING for copying conditions. There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.