-
Notifications
You must be signed in to change notification settings - Fork 1
/
add_new_autochanger_template
57 lines (50 loc) · 1.46 KB
/
add_new_autochanger_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
#
### === Add Virtual Autochanger ===
#
### ========= How to install =========
# 1. cd /opt/bacularis && dcexec bacularis bash
# 2. cd /tmp
# 3. curl https://raw.githubusercontent.com/johann8/bacularis-alpine/master/add_new_autochanger_template --output add_new_autochanger_template
# 4. vi add_new_storage_pool_schedule_template
# 5. bash add_new_autochanger_template
AUTOCHANGER_NAME=FileChgr3
MEDIA_TYPE=File3
ARCHIVE_DEVICE="/var/lib/bacula/archive"
PATH_TO_BACULA_SD="/etc/bacula/bacula-sd.conf"
cat >> ${PATH_TO_BACULA_SD} << EOL
#
# Define a third Virtual autochanger
#
Autochanger {
Name = ${AUTOCHANGER_NAME}
Device = ${AUTOCHANGER_NAME}-Dev1, ${AUTOCHANGER_NAME}-Dev2
Changer Command = ""
Changer Device = /dev/null
}
Device {
Name = ${AUTOCHANGER_NAME}-Dev1
Media Type = ${MEDIA_TYPE}
Archive Device = ${ARCHIVE_DEVICE}
LabelMedia = yes; # lets Bacula label unlabeled media
Random Access = Yes;
AutomaticMount = yes; # when device opened, read it
RemovableMedia = no;
AlwaysOpen = no;
Maximum Concurrent Jobs = 5
}
Device {
Name = ${AUTOCHANGER_NAME}-Dev2
Media Type = ${MEDIA_TYPE}
Archive Device = ${ARCHIVE_DEVICE}
LabelMedia = yes; # lets Bacula label unlabeled media
Random Access = Yes;
AutomaticMount = yes; # when device opened, read it
RemovableMedia = no;
AlwaysOpen = no;
Maximum Concurrent Jobs = 5
}
EOL
### reload bacula-dir daemon
# bconsole
# reload
# quit