Example #1
0
        public bool PerformBackup(BackupParameters parameters)
        {
            AbstractBackupOperation op;

            if (!string.IsNullOrWhiteSpace(parameters.Filesystem))
            {
                op = new FilesystemBackupOperation(parameters);
            }
            else
            {
                op = new DatabaseBackupOperation(parameters);
            }

            try
            {
                if (op.InitBackup())
                {
                    op.WaitForBackup();
                    return(true);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
            finally
            {
                op.Dispose();
            }
            return(false);
        }
Example #2
0
        public bool PerformBackup(BackupParameters parameters)
        {
            AbstractBackupOperation op;

            if (!string.IsNullOrWhiteSpace(parameters.Filesystem))
            {
                op = new FilesystemBackupOperation(parameters);
            }
            else
            {
                op = new DatabaseBackupOperation(parameters);
            }

            try
            {
                if (op.InitBackup())
                {
                    op.WaitForBackup();
                    return true;
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
            finally
            {
                op.Dispose();
            }
            return false;

        }
Example #3
0
        public void file_system_backup_operation_sucessfully_waits_for_backup_to_complete(string requestedStorage)
        {
            using (var store = NewStore(runInMemory: false, requestedStorage: "esent"))
            {
                using (var operation = new FilesystemBackupOperation(new BackupParameters
                {
                    BackupPath = BackupDir,
                    ServerUrl = store.Url,
                    Filesystem = store.DefaultFileSystem
                }))
                {

                    Assert.True(operation.InitBackup());
                    Assert.DoesNotThrow(() => operation.WaitForBackup());
                }
            }
        }