.png)
단일 LTO 드라이브에 넣은 임의의 테이프를 자동으로 재활용하고 사용하도록 Bacula를 구성하려고 하는데 드라이브에 없음에도 불구하고 가장 오래된 백업 테이프를 선호하는 것 같습니다. 이미 모든 테이프를 "사용됨"으로 표시하고 보존 기간이 끝났는지 확인했습니다.
스토리지 conf 및 dir conf SD.conf
Device {
Name = LTO5
Archive Device = /dev/nst0
Device Type = Tape
Media Type = LTO-5
LabelMedia = yes
Random Access = no
#AutoChanger = yes
AutomaticMount = yes
AlwaysOpen = yes
RemovableMedia = yes
Maximum Concurrent Jobs = 1
LabelMedia = yes
Maximum File Size = 12G
디렉터리
Pool {
Name = Default
Pool Type = Backup
Recycle = yes # Bacula can automatically recycle Volumes
AutoPrune = yes # Prune expired volumes
Volume Retention = 15 days
나는 문서를 읽었으며 저장 알고리즘이 드라이브 내 테이프를 선호한다고 말하는 것 같지만 내가 올바르게 이해하고 있다고 생각하지 않습니다.
bacula가 현재 드라이브 내부에 있는 테이프를 사용하도록 강제할 수 있는 방법이 있습니까??
답변1
그래서 작업 전 스크립트를 사용하여 솔루션을 찾았습니다.
이 줄을 작업에 추가하여 dir.conf를 수정했습니다.
Run Before Job = "/etc/bacula/scripts/purgecurrenttape"
퍼지 전류 테이프는 이렇습니다.
#!/bin/bash
#mount the inside-drive tape
echo "mount storage=LTO5" |bconsole| grep " " >> /var/log/scrcintas.log
sleep 5
#get the name of the mounted tape.
cinta=$(echo "status storage=LTO5" | bconsole |grep Volume: |awk '{print $2}')
if [[ $cinta == CINTA* ]]; #check things....
then
#purge tape.
echo "purge volume=$cinta" | bconsole | grep " " >> /var/log/scrcintas.log
sleep
else
echo error >> /var/log/scrcintas.log
fi
이렇게 하면 작업이나 볼륨의 보존 기간에도 불구하고 항상 제거된 테이프를 사용합니다.