Ejemplo n.º 1
0
    protected void btnArchive_Click(object sender, EventArgs e)
    {
        BuckupOptions option  = GetOption();
        BuckupMeneger meneger = new BuckupMeneger();

        meneger.Buckup(option);

        dataSource = GetFiles();
        BackupsGridView.MarkAsChanged();
        //FileListDataBind();
    }
Ejemplo n.º 2
0
    protected void btnArchive_Click(object sender, EventArgs e)
    {
        long excludeFileSize = 0;

        long.TryParse(txbExcludeFileSize.Text, out excludeFileSize);

        DirectoryInfo dir = new DirectoryInfo(HttpContext.Current.Request.PhysicalApplicationPath + "backup\\");

        if (!dir.Exists)
        {
            dir.Create();
        }

        int stepDuration = 0;

        int.TryParse(txbStepDuration.Text, out stepDuration);

        int sleep = 0;

        int.TryParse(txbSleep.Text, out sleep);


        BuckupOptions option = new BuckupOptions
        {
            BuckupFolder      = HttpContext.Current.Request.PhysicalApplicationPath,
            DestinationFolder = dir.FullName,
            ExcludeFiles      = (@"*\bitrix\cache;*\backup;" + (!chbArchivePublicPart.Checked? @"*\bitrix;":string.Empty) + txbExcludeFiles.Text).Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries),
            IncludeCorePart   = chbArchiveCore.Checked,
            ExcludeFileSize   = excludeFileSize * 1024,
            ExcludeStandardTypesCompressing = chbExcludeStandardTypesCompressing.Checked,
            DisableCompresing = chbDisableCompressing.Checked,
            CheckPackage      = chbCheckPackage.Checked,
            IncludeDatabase   = chbIncludeDataBase.Checked,
            StepDuration      = stepDuration * 1000,
            Sleep             = sleep * 1000,
            ConnectionString  = WebConfigurationManager.ConnectionStrings["BXConnectionString"].ConnectionString
        };

        BuckupMeneger.Buckup(option);
        dataSource = GetFiles();
        BackupsGridView.MarkAsChanged();
        //FileListDataBind();
    }