IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 24, 2019, 10:52:39 AM (7 years ago)
Author:
fairlamb
Message:

enabled mysqldump for atlassian backups

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ipp-132_automate_jira_conf_backups/backups/backup_atlassian_applications.py

    r40893 r40894  
    9999        self.verbose               = config.getboolean('atlassian_backups', 'verbose')
    100100
     101        self.mysqldump_password    = _get_str_key_from_section(config, section, 'mysqldump_password')
     102
    101103    def target_backup_paths_ok(self) -> bool:
    102104        copy_paths = [ self.host_backup_path
     
    150152        tar_return = self._tar_attachments()
    151153
     154        # mysqldump
     155        mysqldump_return = self.make_mysql_dump(self.mysqldump_password)
     156
    152157        # If successful: move tmp to old
    153         if jira_return == 0 and conf_return == 0 and tar_return == 0:
     158        if jira_return == 0 and conf_return == 0 and tar_return == 0 and mysqldump_return == 0:
    154159            _move_dir_contents_to_dir(tmp_paths, old_paths, self.verbose)
    155160        else:
     
    252257        # do this as the dumper user
    253258
     259        print(dump_password)
     260
    254261        latest_paths = self.target_paths("latest")
    255262        if not self.target_backup_paths_ok():
     
    270277                         , '--databases', 'jiradb', 'confluencedb'
    271278                         ]
     279        print(mysqldump_args)
    272280        with open(dump_filepath, "w+") as df:
    273281            mysqldump_process = subprocess.Popen(mysqldump_args, stdout=df, stderr=subprocess.PIPE)
     
    278286        if stde is not None:
    279287            decoded_stderr = stde.decode()
     288            print(decoded_stderr)
     289            print(decoded_stderr.casefold().find('error'.casefold()))
    280290            if decoded_stderr.casefold().find('error'.casefold()) > -1:
    281291                raise sub_utils.SubprocessError()
Note: See TracChangeset for help on using the changeset viewer.