Пример #1
0
def wiz_execute(wiz):
    log.debug("Executing backup creation wizard")
    config = Config.get_config()    
    name = wiz.fields["name"].value
    path = wiz.fields["folderpath"].value
    excl = []
    for typ in config.file_types.iterkeys():
        if wiz.fields['excl-'+typ].value:
            excl.append(typ)
    store = wiz.fields["store"].value
    
    b = Backup(name)
    b.active = True
    b.include_folders = [path]
    b.include_packages = True
    b.exclude_types = excl
    b.store = store
    b.excrypt = False
    b.sched_type = "daily/weekly"
    b.sched_times = "19:00/Sun"    
    b.verify = False
    b.notify_msg = True
    b.notify_email = False
    b.shutdown_after = False
    
    config.backups[name] = b
    config.save()
    update_crontab(config.backups)
    
    

    dlg.Info(wiz, _("Your backup has been successfully created."))
    app.broadcast_update()