예제 #1
0
        public void PerformTasks()
        {
            // monitor for final "done" file
            // unzip bak file to temp dir
            // perform sql restore
            // grant permissions in SQL

            // delete temp extracted file

            // Look for STATUS file
            // Read contents and strip the COMPLETE portion to get the timestamp name

            var dateStamp      = $"{DateTime.Now.Year}{DateTime.Now.Month}{DateTime.Now.Day}";
            var statusFilePath = Path.Combine(ConfigSettings.GetSyncDirectoryPath() + @"\", $"STATUS_{dateStamp}.txt");

            if (!File.Exists(statusFilePath))
            {
                return;
            }

            var contents      = File.ReadAllText(statusFilePath);
            var fileTimeStamp = contents.Replace("COMPLETE ", "");

            fileTimeStamp = Regex.Replace(fileTimeStamp, @"\s+", ""); // strip _all_ whitespace

            CliExecute.ExecuteScript($"MinionCommands.{Environment.MachineName.ToUpper()}.bat", fileTimeStamp);
        }
예제 #2
0
        public void PerformTasks()
        {
            // perform SQL back
            // wait for it to finish
            // 7z the file to a BT Sync directory
            // output a final "done" file

            // delete original bak file

            CliExecute.ExecuteScript($"OverlordCommands.{Environment.MachineName.ToUpper()}.bat", "");
        }