8.3.2. Simple Script for Tape Backup

Tape Backup Script Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#!/bin/bash

bkpdate=`date -d "5 days ago" +%Y-%m-%d`-al-`date -d "yesterday" +%Y-%m-%d`

mkdir $bkpdate
scp -r admin@pvenode.domainexample.com:/backup/path ./bkpdate

mt -f /dev/st0 rewind
mt -f /dev/nst0 eom
tar cvf /dev/nst0 $bkpdate
mt -f /dev/st0 rewind