Guest User

Untitled

a guest
Nov 21st, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. DirectoryInfo clmbackup = new DirectoryInfo(@"\BLCbgfdev.igatecorp.comE$CNA_STGINGInsPro_OUTDataFileBackupInsproFilesBackup");
  2.  
  3. FileInfo[] claim = clmbackup.GetFiles("Claims_RDB*").Where(p => p.LastWriteTime <= DateTime.Now.AddMonths(-1)).OrderBy(p => p.CreationTime).ToArray();
  4.  
  5. string[] claimlist = claim.Select(f => f.Name).ToArray();
  6.  
  7. foreach (string f in claimlist)
  8. {
  9.  
  10. int i = -1;
  11. Boolean flag = false;
  12. string fl = f.Substring(0, f.Length - 4);
  13. foreach (string d in Directory.GetDirectories(@"\BLCbgfdev.igatecorp.comE$CNA_STGINGInsPro_OUT"))
  14. {
  15. foreach (string d1 in Directory.GetDirectories(d).Where(folder => folder.Contains("abc")))
  16. {
  17. DirectoryInfo df = new DirectoryInfo(d1);
  18. //FileInfo[] claim1 = df.GetFiles("Claims_RDB*").OrderBy(p => p.CreationTime).ToArray();
  19.  
  20. FileInfo[] claim1 = df.GetFiles("Claims_RDB*").OrderBy(p => p.CreationTime).ToArray();
  21.  
  22. string[] claimlist1 = claim1.Select(f1 => f1.Name).ToArray();
  23.  
  24.  
  25. foreach (string fileToCheck in claimlist1)
  26. {
  27. if (fileToCheck.Contains(f))
  28. {
  29. flag = true;
  30.  
  31. string delete = @"E:CNA_STGINGInsPro_OUTDataFileBackupInsproFilesBackup";
  32.  
  33. File.Delete(delete+f);
  34.  
  35.  
  36. backupchecktableupdate(fileToCheck, df);
  37. goto Main;
  38. }
  39. }
  40. if (flag == false)
  41. {
  42. flag = false;
  43. goto Inner;
  44. }
  45. }
  46. Inner: continue;
  47. }
  48. if (flag == false)
  49. {
  50. _log.WriteLog("File " + f + " Not Found");
  51.  
  52. }
  53. Main: continue;
  54. }
  55.  
  56.  
  57. CompletedeletionSummaryStatus();
  58. }
Add Comment
Please, Sign In to add comment