-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProgram.cs
More file actions
78 lines (69 loc) · 2.85 KB
/
Program.cs
File metadata and controls
78 lines (69 loc) · 2.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
using System;
using System.Collections.Generic;
using System.IO;
using Backups.Classes.JobObjects;
using Backups.Classes.RestorePoints;
using Backups.Classes.StorageAlgorithms;
using Backups.Services;
using BackupsExtra.Classes.BackupJobsExtra;
using BackupsExtra.Classes.BackupLogs;
using BackupsExtra.Classes.Recovery;
using BackupsExtra.Classes.Selection;
using BackupsExtra.Classes.Serialization;
using BackupsExtra.Classes.StorageMethodsExtra;
using BackupsExtra.Services;
using Serilog;
using Serilog.Sinks.SystemConsole.Themes;
namespace BackupsExtra
{
internal class Program
{
private static void Main()
{
string dataStorage = Path.Combine(
Path.Combine(
Directory.GetParent(Directory.GetCurrentDirectory())?
.Parent?
.FullName!),
"Data");
var service = new BackupJobServiceExtra(
new BackupJobService(dataStorage, new FileSystemStorageExtra()),
new FileSystemStorageExtra());
/*
BackupJobExtra backup = service.CreateBackup(
new HashSet<IJobObject>
{
new JobObject("/Users/artyomfadeyev/Documents/a.txt"),
new JobObject("/Users/artyomfadeyev/Documents/b.txt"),
new JobObject("/Users/artyomfadeyev/Documents/c.txt"),
},
new SplitStorages(),
new FileLogger(dataStorage),
"backup");
backup.CreateRestorePoint("1");
backup.CreateRestorePoint("2");
backup.CreateRestorePoint("3");
backup.Clear(new ByNumberSelection(2));
backup.RemoveJobObject(new JobObject("/Users/artyomfadeyev/Documents/c.txt"));
backup.CreateRestorePoint("4");
backup.RemoveJobObject(new JobObject("/Users/artyomfadeyev/Documents/b.txt"));
backup.CreateRestorePoint("5");
backup.AddJobObject(new JobObject("/Users/artyomfadeyev/Documents/d.txt"));
backup.AddJobObject(new JobObject("/Users/artyomfadeyev/Documents/adqweqwe.txt"));
backup.CreateRestorePoint("6");
backup.Merge(new ByNumberSelection(1));
RestorePoint lastRp = backup.Top();
var recovery = new DifferentLocationRecover(Path.Combine(dataStorage, "recover"));
recovery.Recover(backup.StorageMethod, lastRp);
var json = new JsonSerialization(dataStorage);
json.Save(service);
BackupJobServiceExtra load = json.Load();*/
// Console.WriteLine(load.FullPath);
// foreach (BackupJobExtra back in load.BackupsI)
// {
// Console.Write(back.Name + " " + back.RestorePoints.Count);
// }
// Console.WriteLine();
}
}
}