private void BackupFolder([NotNull] BackupArgs args, [NotNull] string path, [NotNull] string fileName, string ignore = null) { Assert.ArgumentNotNull(args, "args"); Assert.ArgumentNotNull(path, "path"); Assert.ArgumentNotNull(fileName, "fileName"); if (FileSystem.FileSystem.Local.Directory.Exists(path)) { var backupfile = Path.Combine(args.Folder, fileName); FileSystem.FileSystem.Local.Zip.CreateZip(path, backupfile, ignore); } }
protected override void Process([NotNull] BackupArgs args) { Assert.ArgumentNotNull(args, nameof(args)); var instance = args.Instance; Assert.IsNotNull(instance, nameof(instance)); var backupDatabasesFolder = FileSystem.FileSystem.Local.Directory.Ensure(Path.Combine(args.Folder, "Databases")); foreach (Database database in instance.AttachedDatabases) { Backup(database, backupDatabasesFolder); IncrementProgress(); } }
protected override void Process([NotNull] BackupArgs args) { Assert.ArgumentNotNull(args, "args"); var instance = args.Instance; Assert.IsNotNull(instance, "instance"); var backupDatabasesFolder = FileSystem.FileSystem.Local.Directory.Ensure(Path.Combine(args.Folder, "MongoDatabases")); foreach (var database in instance.MongoDatabases) { MongoHelper.Backup(database, backupDatabasesFolder); this.IncrementProgress(); } }
protected override void Process(BackupArgs args) { Assert.ArgumentNotNull(args, "args"); Log.Info("Starting website " + args.InstanceName, this); try { if (args.Instance.ApplicationPoolState != ObjectState.Started) { args.Instance.Start(); } } catch (Exception ex) { var @params = new[] { args.InstanceName, ex.Message }; Log.Warn("Can't start instance {0}. {1}".FormatWith(@params), base.GetType(), ex); } }
protected override void Process([NotNull] BackupArgs args) { Assert.ArgumentNotNull(args, "args"); var instance = args.Instance; var webRootPath = instance.WebRootPath; if (args.BackupClient) { this.BackupFolder(args, webRootPath, "WebRoot.zip"); } else { this.BackupFolder(args, webRootPath, "WebRootNoClient.zip", "sitecore"); } this.IncrementProgress(); this.BackupFolder(args, instance.DataFolderPath, "Data.zip"); }
protected override bool IsRequireProcessing(BackupArgs args) { Assert.ArgumentNotNull(args, "args"); return args.BackupFiles; }
protected override long EvaluateStepsCount(BackupArgs args) { Assert.ArgumentNotNull(args, "args"); return 2; }
protected override long EvaluateStepsCount(BackupArgs args) { Assert.ArgumentNotNull(args, "args"); return args.Instance.AttachedDatabases.Count(); }
public override ProcessorArgs ToProcessorArgs() { var backupArgs = new BackupArgs(this.Instance, FileSystem.FileSystem.Local.Path.EscapePath(this.BackupName.Trim(), "."), this.Files, this.Databases, this.ExcludeClient, this.MongoDatabases); return backupArgs; }
protected abstract void Process([NotNull] BackupArgs args);
protected virtual bool IsRequireProcessing([NotNull] BackupArgs args) { Assert.ArgumentNotNull(args, nameof(args)); return(true); }
protected virtual long EvaluateStepsCount(BackupArgs args) { return(1); }
protected override long EvaluateStepsCount(BackupArgs args) { Assert.ArgumentNotNull(args, "args"); return(args.Instance.MongoDatabases.Count()); }
protected override long EvaluateStepsCount(BackupArgs args) { Assert.ArgumentNotNull(args, nameof(args)); return(args.Instance.AttachedDatabases.Count()); }
protected override long EvaluateStepsCount(BackupArgs args) { Assert.ArgumentNotNull(args, "args"); return(2); }
protected override bool IsRequireProcessing(BackupArgs args) { Assert.ArgumentNotNull(args, nameof(args)); return(args.BackupDatabases); }
protected override bool IsRequireProcessing(BackupArgs args) { Assert.ArgumentNotNull(args, "args"); return(args.BackupFiles); }
protected virtual long EvaluateStepsCount(BackupArgs args) { return 1; }
protected override void Process(BackupArgs args) { Assert.ArgumentNotNull(args, "args"); InstanceHelper.StopInstance(args.Instance); }