コード例 #1
0
        private static void Main(CompressUtil dir)
        {
            BackupClass backup = dir.GetLatestBackup();

            if ((DateTime.Now - backup.CreatedOn).TotalDays > 7)
            {
                backup = dir.CreateBackup();
            }

            List <string> dirsToBackup = new List <string>(ConfigurationManager.AppSettings["DirectoriesToBackup"].Split(';'));

            foreach (var dirPath in dirsToBackup)
            {
                DirToBackup dirToBackup = new DirToBackup(dirPath, DirectoryUtil.GetFolderName(dirPath), backup);
                dirToBackup.StartBackup();
                dirToBackup.DoneBackup();
            }
        }