-
Notifications
You must be signed in to change notification settings - Fork 1
/
add_new_storage_pool_schedule_template
86 lines (76 loc) · 2.74 KB
/
add_new_storage_pool_schedule_template
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
79
80
81
82
83
84
85
86
#
### === Add Storage and Pool for Archive and new Scheduler ===
#
# 1. cd /opt/bacularis && dcexec bacularis bash
# 2. cd /tmp
# 3. curl https://raw.githubusercontent.com/johann8/bacularis-alpine/master/add_new_storage_pool_schedule_template --output add_new_storage_pool_schedule_template
# 4. vi add_new_storage_pool_schedule_template
# 5. bash add_new_storage_pool_schedule_template
# Set variables
PATH_TO_BACULA_DIR="/etc/bacula/bacula-dir.conf"
MEDIA_TYPE=File3
DEVICE_NAME=FileChgr3
POOL_NAME_WIN=Archive_Win
POOL_NAME_LIN=Archive_Lin
STORAGE_IP=${DOCKER_HOST_IP}
STORAGE_PWD=$(cat ${PATH_TO_BACULA_DIR} |sed -n '/Storage {/,+5p' | head -n 5 |grep -iw 'password' | cut -d '"' -f 2)
cat >> ${PATH_TO_BACULA_DIR} << EOL
# define new storage
Storage {
Name = "${MEDIA_TYPE}_Archive"
Description = "Only for Archive"
SdPort = 9103
Address = "${STORAGE_IP}"
Password = "${STORAGE_PWD}"
Device = "${DEVICE_NAME}"
MediaType = "${MEDIA_TYPE}_Archive"
Autochanger = "${MEDIA_TYPE}_Archive"
MaximumConcurrentJobs = 10
}
# Add pool for archive Windows
Pool {
Recycle = yes
AutoPrune = yes
PoolType = "Backup"
MaximumVolumes = 10
Storage = "${MEDIA_TYPE}_Archive"
Name = "${POOL_NAME_WIN}"
Description = "Only for Windows Archive"
LabelFormat = "${POOL_NAME_WIN}-"
MaximumVolumeBytes = 53687091200
VolumeRetention = 31536000
}
# Add pool for archive Linux
Pool {
Recycle = yes
AutoPrune = yes
PoolType = "Backup"
MaximumVolumes = 10
Storage = "${MEDIA_TYPE}_Archive"
Name = "${POOL_NAME_LIN}"
Description = "Only for Linux Archive"
LabelFormat = "${POOL_NAME_LIN}-"
MaximumVolumeBytes = 53687091200
VolumeRetention = 31536000
}
# Add Archive Scheduler for Windows
Schedule {
Name = "MonthlyCycle-Archive-Win"
Description = "Archive Scheduler for Windows"
Run = Pool="${POOL_NAME_WIN}" Level="Incremental" Storage="${MEDIA_TYPE}_Archive" feb,mar,apr,may,jun,aug,sep,oct,nov,dec 1st,2nd,3rd,5th sun at 00:30
Run = Pool="${POOL_NAME_WIN}" Level="Differential" Storage="${MEDIA_TYPE}_Archive" feb,mar,apr,may,jun,aug,sep,oct,nov,dec 4th sun at 00:30
Run = Pool="${POOL_NAME_WIN}" Level="Full" Storage="${MEDIA_TYPE}_Archive" jan,jul 1st sun at 00:30
}
# Add Archive Scheduler for Linux
Schedule {
Name = "MonthlyCycle-Archive-Lin"
Description = "Archive Scheduler for Linux"
Run = Pool="${POOL_NAME_LIN}" Level="Incremental" Storage="${MEDIA_TYPE}_Archive" feb,mar,apr,may,jun,aug,sep,oct,nov,dec 1st,2nd,3rd,5th sun at 00:30
Run = Pool="${POOL_NAME_LIN}" Level="Differential" Storage="${MEDIA_TYPE}_Archive" feb,mar,apr,may,jun,aug,sep,oct,nov,dec 4th sun at 00:30
Run = Pool="${POOL_NAME_LIN}" Level="Full" Storage="${MEDIA_TYPE}_Archive" jan,jul 1st sun at 00:30
}
EOL
### reload bacula-dir
# bconsole
# reload
# quit