-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbackups.ps1
43 lines (32 loc) · 933 Bytes
/
backups.ps1
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
# путь к WinRAR
$rar = 'C:\Program Files\WinRAR\Rar.exe'
# куда архивируем личные папки
$Logfile = 'E:\AWS\Logapp.log'
#Stage 1 backup C:
$Path = 'C:\BPMOnlineAppFiles\'
Remove-Item E:\AWS\CAPPS\*
ForEach ($n in Get-ChildItem -Path $Path -Force) {
$FilesArh = 'E:\AWS\CAPPS\' + $n + '.rar'
$Dir = $Path + $n
&$rar a "$FilesArh" $Dir -r >> $LogFile
echo $n + 'backuped'
}
#Stage 1 backup E:
$Path = 'E:\BPM\'
Remove-Item E:\AWS\EAPPS\*
ForEach ($n in Get-ChildItem -Path $Path -Force) {
$FilesArh = 'E:\AWS\EAPPS\' + $n + '.rar'
$Dir = $Path + $n
&$rar a "$FilesArh" $Dir -r >> $LogFile
echo $n + 'backuped'
}
#Stage 1 backup F:
$Path = 'F:\BPMAPPfiles\'
Remove-Item E:\AWS\FAPPS\*
ForEach ($n in Get-ChildItem -Path $Path -Force) {
$FilesArh = 'E:\AWS\FAPPS\' + $n + '.rar'
$Dir = $Path + $n
&$rar a "$FilesArh" $Dir -r >> $LogFile
echo $n + 'backuped'
}
echo "success"