示例#1
0
    def backup(self):
        # Do a system backup before update
        sickrage.app.log.info("Config backup in progress...")
        sickrage.app.alerts.message(_('Updater'),
                                    _('Config backup in progress...'))
        try:
            backupDir = os.path.join(sickrage.app.data_dir, 'backup')
            if not os.path.isdir(backupDir):
                os.mkdir(backupDir)

            if backupSR(backupDir, keep_latest=True):
                sickrage.app.log.info("Config backup successful, updating...")
                sickrage.app.alerts.message(
                    _('Updater'), _('Config backup successful, updating...'))
                return True
            else:
                sickrage.app.log.warning(
                    "Config backup failed, aborting update")
                sickrage.app.alerts.error(
                    _('Updater'), _('Config backup failed, aborting update'))
                return False
        except Exception as e:
            sickrage.app.log.warning(
                'Update: Config backup failed. Error: {}'.format(e))
            sickrage.app.alerts.error(
                _('Updater'), _('Config backup failed, aborting update'))
            return False
示例#2
0
    def _runbackup(self):
        # Do a system backup before update
        sickrage.srCore.srLogger.info("Config backup in progress...")
        sickrage.srCore.srNotifications.message(
            'Backup', 'Config backup in progress...')
        try:
            backupDir = os.path.join(sickrage.DATA_DIR, 'backup')
            if not os.path.isdir(backupDir):
                os.mkdir(backupDir)

            if self._keeplatestbackup(backupDir) and backupSR(backupDir):
                sickrage.srCore.srLogger.info(
                    "Config backup successful, updating...")
                sickrage.srCore.srNotifications.message(
                    'Backup', 'Config backup successful, updating...')
                return True
            else:
                sickrage.srCore.srLogger.error(
                    "Config backup failed, aborting update")
                sickrage.srCore.srNotifications.message(
                    'Backup', 'Config backup failed, aborting update')
                return False
        except Exception as e:
            sickrage.srCore.srLogger.error(
                'Update: Config backup failed. Error: %s' % e)
            sickrage.srCore.srNotifications.message(
                'Backup', 'Config backup failed, aborting update')
            return False
示例#3
0
    def backup(self):
        # Do a system backup before update
        sickrage.app.log.info("Config backup in progress...")
        sickrage.app.alerts.message(_('Updater'),
                                    _('Config backup in progress...'))
        try:
            backupDir = os.path.join(sickrage.app.data_dir, 'backup')
            if not os.path.isdir(backupDir):
                os.mkdir(backupDir)

            if backupSR(backupDir, keep_latest=True):
                sickrage.app.log.info("Config backup successful, updating...")
                sickrage.app.alerts.message(_('Updater'),
                                            _('Config backup successful, updating...'))
                return True
            else:
                sickrage.app.log.warning("Config backup failed, aborting update")
                sickrage.app.alerts.error(_('Updater'),
                                          _('Config backup failed, aborting update'))
                return False
        except Exception as e:
            sickrage.app.log.warning('Update: Config backup failed. Error: {}'.format(e))
            sickrage.app.alerts.error(_('Updater'),
                                      _('Config backup failed, aborting update'))
            return False
示例#4
0
    def _runbackup(self):
        # Do a system backup before update
        sickrage.srCore.srLogger.info("Config backup in progress...")
        sickrage.srCore.srNotifications.message('Backup', 'Config backup in progress...')
        try:
            backupDir = os.path.join(sickrage.DATA_DIR, 'backup')
            if not os.path.isdir(backupDir):
                os.mkdir(backupDir)

            if self._keeplatestbackup(backupDir) and backupSR(backupDir):
                sickrage.srCore.srLogger.info("Config backup successful, updating...")
                sickrage.srCore.srNotifications.message('Backup', 'Config backup successful, updating...')
                return True
            else:
                sickrage.srCore.srLogger.error("Config backup failed, aborting update")
                sickrage.srCore.srNotifications.message('Backup', 'Config backup failed, aborting update')
                return False
        except Exception as e:
            sickrage.srCore.srLogger.error('Update: Config backup failed. Error: %s' % e)
            sickrage.srCore.srNotifications.message('Backup', 'Config backup failed, aborting update')
            return False