Iâm digging into the backup.py scripts from 1.1.0 and 1.3.1 extracted from the docker images.
Cause Iâm a new user I canât upload any file.
I find out that version 1.1.0 script has mk_dir definition for /data/scriptlogs /data/backups in case of they donât exists while version 1.3.1 has not this case controlled so this is the reason I believe it fails.
Extract found script 1.1.0 in /opt/couchbase/bin/
It has the mounts on data on both version of course lines 41-44
MOUNT_LOCATION = os.path.join("/data")
BACKUPS_LOCATION = os.path.join(MOUNT_LOCATION, "backups")
LOGS_LOCATION = os.path.join(MOUNT_LOCATION, "scriptlogs")
STAGING_LOCATION = os.path.join(MOUNT_LOCATION, "staging")
And the making dir def lines 305-308
def create_local_archive(context):
"""
Creates a local archive if required, and initializes a repository
if one is required.
"""
if context.args.mode == MODE_RESTORE:
return
if context.args.s3_bucket:
if context.args.config:
config_repo(context)
return
archive_created = False
if not os.access(BACKUPS_LOCATION, os.F_OK):
archive_created = mk_dir(BACKUPS_LOCATION)
# remove any lock leftover by a dangling cbbackupmgr process
logging.debug("Removing stale lock file")
if os.path.exists(os.path.join(BACKUPS_LOCATION, "lock.lk")):
os.remove(os.path.join(BACKUPS_LOCATION, "lock.lk"))
# if archive directory was created e.g. an incremental was scheduled
# first, or we're forcing a new one, configure it.
if archive_created or context.args.config:
logging.info("Performing config as backup archive was just created")
config_repo(context)
Extract found script 1.3.1 in /usr/local/bin/ lines 41-44
MOUNT_LOCATION = os.path.join("/data")
BACKUPS_LOCATION = os.path.join(MOUNT_LOCATION, "backups")
LOGS_LOCATION = os.path.join(MOUNT_LOCATION, "scriptlogs")
STAGING_LOCATION = os.path.join(MOUNT_LOCATION, "staging")
And the initialization of Backups and logs location lines 112-125
def __init__(self, **kwargs):
"""
Initialialize defaults that cannot go wrong.
Don't put any calls in here, they cannot be mocked during initialization.
"""
self.log_path = LOGS_LOCATION
if 'log_path' in kwargs:
self.log_path = kwargs['log_path']
self.archive = BACKUPS_LOCATION
if 'archive' in kwargs:
self.archive = kwargs['archive']
self.timestamp = datetime.now()