예제 #1
0
        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();
            }
        }
예제 #3
0
        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);
              }
        }
예제 #5
0
        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;
        }
예제 #10
0
 protected abstract void Process([NotNull] BackupArgs args);
예제 #11
0
        protected virtual bool IsRequireProcessing([NotNull] BackupArgs args)
        {
            Assert.ArgumentNotNull(args, nameof(args));

            return(true);
        }
예제 #12
0
 protected virtual long EvaluateStepsCount(BackupArgs args)
 {
     return(1);
 }
예제 #13
0
        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());
        }
예제 #15
0
        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);
        }
예제 #17
0
        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);
 }