Beispiel #1
0
        private static string GenerateFileName(BackupJob job)
        {
            const string format = "yyyy-MM-dd HH:mm:ss.fff";
            var          now    = DateTime.Now.ToString(format);

            now = now.Replace(":", "_");
            return(job.DatabaseName + "__" + now + ".bak");
        }
Beispiel #2
0
        public void Run(BackupJob job)
        {
            Logger.Debug("Started .Run BackupJobManager");

            var fileName = GenerateFileName(job);

            Logger.Debug("BackupProvider.Create .Run BackupJobManager");

            var backupProvider = job.BackupProvider.Create();
            var storage        = new Storage();

            foreach (var storageFactory in job.Storages)
            {
                storage.Add(storageFactory.Create());
            }
            var tempFileLocation = Path.Combine(job.TempDirectory, fileName);

            backupProvider.Start(job.DatabaseName, fileName, tempFileLocation, storage);
            Logger.Debug("Completed .Run BackupJobManager");
        }