Exemple #1
0
        static void Main(string[] args)
        {
            globalvars gvar = new globalvars();

            creatdirifnotexist(gvar.LogDirectory);
            creatdirifnotexist(gvar.BackUpDirectory);
            creatdirifnotexist(gvar.squashNetworkBackupPath);
            Console.WriteLine("Started Backup Process..");
            logMessage("Backup Process Started");
            if (gvar.bkup.ToLower() == "true")
            {
                Console.WriteLine("1. Perform Backup");
                PerformMySqlBackUP(gvar.CommandDirectory, gvar.BackUpDirectory, gvar.mySQLtableslistfilename);
            }
            if (gvar.compress.ToLower() == "true")
            {
                Console.WriteLine("2. Perform Compression");
                PerformCompression(gvar.BackUpDirectory, gvar.getBackupFolderName());
            }
            if (gvar.robocopy.ToLower() == "true")
            {
                Console.WriteLine("3. Perform Coopy");
                PerformRoboCopy(gvar.BackUpDirectory, gvar.squashNetworkBackupPath, "");
            }
            if (gvar.email.ToLower() == "true")
            {
                Console.WriteLine("4. Send Email Notifiction");
                SendEmailNotification(gvar.getBackupFolderName(), gvar.squashNetworkBackupPath, gvar.emaiList);
            }
            Console.WriteLine("Completed Backup Process..");
            logMessage("Backup Process Completed");
        }
        static void Main(string[] args)
        {
            
            globalvars  gvar = new globalvars();
            creatdirifnotexist(gvar.LogDirectory);
            creatdirifnotexist(gvar.BackUpDirectory);
            creatdirifnotexist(gvar.squashNetworkBackupPath);
            Console.WriteLine("Started Backup Process..");
            logMessage("Backup Process Started");
            if (gvar.bkup.ToLower() == "true")
            {
                Console.WriteLine("1. Perform Backup");
                PerformMySqlBackUP(gvar.CommandDirectory, gvar.BackUpDirectory, gvar.mySQLtableslistfilename);
            }
            if (gvar.compress.ToLower() == "true")
            {
                Console.WriteLine("2. Perform Compression");
                PerformCompression(gvar.BackUpDirectory, gvar.getBackupFolderName());
            }
            if (gvar.robocopy.ToLower() == "true")
            {
                Console.WriteLine("3. Perform Coopy");
                PerformRoboCopy(gvar.BackUpDirectory, gvar.squashNetworkBackupPath, "");
            }
            if (gvar.email.ToLower() == "true")
            {
                Console.WriteLine("4. Send Email Notifiction");
                SendEmailNotification(gvar.getBackupFolderName(), gvar.squashNetworkBackupPath, gvar.emaiList);
            }
            Console.WriteLine("Completed Backup Process..");
            logMessage("Backup Process Completed");

        }
Exemple #3
0
        public static void logMessage(string msgtxt)
        {
            globalvars gvar = new globalvars();

            File.AppendAllText(gvar.LogFile, DateTime.Now + ":" + msgtxt + Environment.NewLine);
        }
 public static void logMessage(string msgtxt)
 {
     globalvars  gvar = new globalvars();
     File.AppendAllText(gvar.LogFile,DateTime.Now +":"+ msgtxt+ Environment.NewLine);
 }