parameters: ()
return_statement: return True,'Risk-free'
docstring: @name 开始检测
          @author hwliang<2020-08-03>
          @return tuple (status<bool>,msg<string>)
function: def check_run():
      '''
          @name 开始检测
          @author hwliang<2020-08-03>
          @return tuple (status<bool>,msg<string>)        
      '''
  
      if public.M('crontab').where('sType=? AND sName=?',('database','ALL')).count():
          return True,'Risk-free'
  
      db_list = public.M('databases').field('name').select()
  
      not_backups = []
      sql = public.M('crontab')
      for db in db_list:
          if sql.where('sType=? AND sName=?',('database',db['name'])).count():
              continue
          not_backups.append(db['name'])
  
      if not_backups:
          return False ,'The following databases are not set up for regular backup: <br />' + ('<br />'.join(not_backups))
      
      return True,'Risk-free'
function_tokens: def check_run ( ) : if public . M ( 'crontab' ) . where ( 'sType=? AND sName=?' , ( 'database' , 'ALL' ) ) . count ( ) : return True , 'Risk-free' db_list = public . M ( 'databases' ) . field ( 'name' ) . select ( ) not_backups = [ ] sql = public . M ( 'crontab' ) for db in db_list : if sql . where ( 'sType=? AND sName=?' , ( 'database' , db [ 'name' ] ) ) . count ( ) : continue not_backups . append ( db [ 'name' ] ) if not_backups : return False , 'The following databases are not set up for regular backup: <br />' + ( '<br />' . join ( not_backups ) ) return True , 'Risk-free'