def start(self):

        #check if a backup should be resumed
        resumeRestore = self._resumeCheck()

        if (resumeRestore):
            restore = XbmcBackup()
            restore.selectRestore(self.restore_point)
            #skip the advanced settings check
            restore.skipAdvanced()
            restore.run(XbmcBackup.Restore)

        while (not xbmc.abortRequested):

            if (self.enabled == "true"):
                #scheduler is still on
                now = time.time()

                if (self.next_run <= now):
                    progress_mode = int(utils.getSetting('progress_mode'))
                    self.doScheduledBackup(progress_mode)

                    #check if we should shut the computer down
                    if (utils.getSetting("cron_shutdown") == 'true'):
                        #wait 10 seconds to make sure all backup processes and files are completed
                        time.sleep(10)
                        xbmc.executebuiltin('ShutDown()')
                    else:
                        #find the next run time like normal
                        self.findNextRun(now)

            xbmc.sleep(500)

        #delete monitor to free up memory
        del self.monitor
Exemplo n.º 2
0
    def start(self):

        #check if a backup should be resumed
        resumeRestore = self._resumeCheck()

        if(resumeRestore):
            restore = XbmcBackup()
            restore.selectRestore(self.restore_point)
            #skip the advanced settings check
            restore.skipAdvanced()
            restore.run(XbmcBackup.Restore)
        
        while(not xbmc.abortRequested):
            
            if(self.enabled == "true"):
                #scheduler is still on
                now = time.time()

                if(self.next_run <= now):
                    progress_mode = int(utils.getSetting('progress_mode'))
                    self.doScheduledBackup(progress_mode)

                    #check if we should shut the computer down
                    if(utils.getSetting("cron_shutdown") == 'true'):
                        #wait 10 seconds to make sure all backup processes and files are completed
                        time.sleep(10)
                        xbmc.executebuiltin('ShutDown()')
                    else:
                        #find the next run time like normal
                        self.findNextRun(now)

            xbmc.sleep(500)

        #delete monitor to free up memory
        del self.monitor
Exemplo n.º 3
0
    def start(self):

        #check if a backup should be resumed
        resumeRestore = self._resumeCheck()

        if(resumeRestore):
            restore = XbmcBackup()
            restore.selectRestore(self.restore_point)
            #skip the advanced settings check
            restore.skipAdvanced()
            restore.run(XbmcBackup.Restore)
        
        while(not xbmc.abortRequested):
            
            if(self.enabled == "true"):
                #scheduler is still on
                now = time.time()

                if(self.next_run <= now):
                    if(utils.getSetting('run_silent') == 'false'):
                        utils.showNotification(utils.getString(30053))
                    #run the job in backup mode, hiding the dialog box
                    backup = XbmcBackup()
                    backup.run(XbmcBackup.Backup,True)

                    #check if we should shut the computer down
                    if(utils.getSetting("cron_shutdown") == 'true'):
                        #wait 10 seconds to make sure all backup processes and files are completed
                        time.sleep(10)
                        xbmc.executebuiltin('ShutDown()')
                    else:
                        #find the next run time like normal
                        self.findNextRun(now)

            xbmc.sleep(500)
Exemplo n.º 4
0
    def start(self):

        #check if a backup should be resumed
        resumeRestore = self._resumeCheck()

        if(resumeRestore):
            restore = XbmcBackup()
            restore.selectRestore(self.restore_point)
            #skip the advanced settings check
            restore.skipAdvanced()
            restore.run(XbmcBackup.Restore)
        
        while(not xbmc.abortRequested):
            
            if(self.enabled == "true"):
                #scheduler is still on
                now = time.time()

                if(self.next_run <= now):
                    progress_mode = int(utils.getSetting('progress_mode'))
                    if(progress_mode != 2):
                        utils.showNotification(utils.getString(30053))
                    
                    backup = XbmcBackup()

                    if(backup.remoteConfigured()):

                        if(int(utils.getSetting('progress_mode')) in [0,1]):
                            backup.run(XbmcBackup.Backup,True)
                        else:
                            backup.run(XbmcBackup.Backup,False)

                        #check if this is a "one-off"
                        if(int(utils.getSetting("schedule_interval")) == 0):
                            #disable the scheduler after this run
                            self.enabled = "false"
                            utils.setSetting('enable_scheduler','false')
                    else:
                        utils.showNotification(utils.getString(30045))
                        
                    #check if we should shut the computer down
                    if(utils.getSetting("cron_shutdown") == 'true'):
                        #wait 10 seconds to make sure all backup processes and files are completed
                        time.sleep(10)
                        xbmc.executebuiltin('ShutDown()')
                    else:
                        #find the next run time like normal
                        self.findNextRun(now)

            xbmc.sleep(500)

        #delete monitor to free up memory
        del self.monitor
Exemplo n.º 5
0
    def start(self):

        #check if a backup should be resumed
        resumeRestore = self._resumeCheck()

        if (resumeRestore):
            restore = XbmcBackup()
            restore.selectRestore(self.restore_point)
            #skip the advanced settings check
            restore.skipAdvanced()
            restore.run(XbmcBackup.Restore)

        while (not xbmc.abortRequested):

            if (self.enabled == "true"):
                #scheduler is still on
                now = time.time()

                if (self.next_run <= now):
                    progress_mode = int(utils.getSetting('progress_mode'))
                    if (progress_mode != 2):
                        utils.showNotification(utils.getString(30053))

                    backup = XbmcBackup()

                    if (backup.remoteConfigured()):

                        if (int(utils.getSetting('progress_mode')) in [0, 1]):
                            backup.run(XbmcBackup.Backup, True)
                        else:
                            backup.run(XbmcBackup.Backup, False)

                        #check if this is a "one-off"
                        if (int(utils.getSetting("schedule_interval")) == 0):
                            #disable the scheduler after this run
                            self.enabled = "false"
                            utils.setSetting('enable_scheduler', 'false')
                    else:
                        utils.showNotification(utils.getString(30045))

                    #check if we should shut the computer down
                    if (utils.getSetting("cron_shutdown") == 'true'):
                        #wait 10 seconds to make sure all backup processes and files are completed
                        time.sleep(10)
                        xbmc.executebuiltin('ShutDown()')
                    else:
                        #find the next run time like normal
                        self.findNextRun(now)

            xbmc.sleep(500)

        #delete monitor to free up memory
        del self.monitor
Exemplo n.º 6
0
    def start(self):

        # display upgrade messages if they exist
        if (utils.getSettingInt('upgrade_notes') < UPGRADE_INT):
            xbmcgui.Dialog().ok(utils.getString(30010), utils.getString(30132))
            utils.setSetting('upgrade_notes', str(UPGRADE_INT))

        # check if a backup should be resumed
        resumeRestore = self._resumeCheck()

        if (resumeRestore):
            restore = XbmcBackup()
            restore.selectRestore(self.restore_point)
            # skip the advanced settings check
            restore.skipAdvanced()
            restore.restore()

        while (not self.monitor.abortRequested()):

            if (self.enabled):
                # scheduler is still on
                now = time.time()

                if (self.next_run <= now):
                    progress_mode = utils.getSettingInt('progress_mode')
                    self.doScheduledBackup(progress_mode)

                    # check if we should shut the computer down
                    if (utils.getSettingBool("cron_shutdown")):
                        # wait 10 seconds to make sure all backup processes and files are completed
                        time.sleep(10)
                        xbmc.executebuiltin('ShutDown()')
                    else:
                        # find the next run time like normal
                        self.findNextRun(now)

            xbmc.sleep(500)

        # delete monitor to free up memory
        del self.monitor