Data Repository Backup/Copycluster scheduled via cron after upgrading to 23.3.11 or later
search cancel

Data Repository Backup/Copycluster scheduled via cron after upgrading to 23.3.11 or later

book

Article ID: 376644

calendar_today

Updated On:

Products

DX NetOps CA Performance Management - Usage and Administration

Issue/Introduction

Since upgrading to 23.3.11 or later, cron scheduled backups/copycluster jobs fail with the error:

==========

Error: Configured database name 'DATABASENAME' not found in cluster.  Available:
  WARNING:  The admin tools depend on your login shell being /bin/bash.
    Your login shell is currently set to /bin/sh.  If you continue to run the admin tools
    with this default shell you may experience technical difficulties. If you want
    to suppress this warning
  please set suppress_shell_warning = True in Configuration
    section in admintools.conf.
    
Do you wish to continue? (Y/N)
  please set suppress_shell_warning = True in Configuration
    section in admintools.conf.
    
Do you wish to continue? (Y/N)
DATABASENAME

==========

The same jobs run successfully when run manually.

The Data Repository administrator account on all involved Data Repository nodes is /bin/bash

The shell utilized by the backup/copycluster script is bash.


Environment

DX NetOps Performance Management 23.3.11 and later

Cause

The Data Repository Vertica database has introduced a check of the SHELL environmental variable to verify the shell of the Data Repository administrator is the required /bin/bash when adminTools commands are run.

This is triggered when the vbr.py based backup/copycluster commands are run.

The cron utility overrides the SHELL variable with a value of /bin/sh. 

Form the cron(5) man page:

"Several environment variables are set up automatically by the cron(8) daemon.  SHELL is set to /bin/sh, and LOGNAME and HOME are set from the /etc/passwd line of the crontab´s owner.  HOME
       and SHELL can be overridden by settings in the crontab; LOGNAME can not"

As SHELL is overridden, the error occurs regardless of the shell of the Data Repository administrator or the shell specified in the script containing the vbr commands.


Resolution

At the top of the crontab for the Data Repository administrator where the backup/copycluster is scheduled add the following at the top before any of the backup/copycluster jobs:

SHELL=/bin/bash

Example

SHELL=/bin/bash
00 02 * * *   /home/vertica/backup_script.sh >/tmp/backup.log  2>&1

Additional Information

To edit the crontab of the Data Repository administrator, as the Data Repository administrator run:

crontab -e

Back Up the Data Repository
Data Repository Disaster Recovery configuration