BareOS¶
fullbackup every client¶
for client in $(echo list clients | bconsole | awk '/example.com/&&NR>3{print $4}'); do echo run job=$client level=Full yes | bconsole; done
prune all jobs¶
for client in $(echo list clients | bconsole | awk '/example.com/&&NR>3{print $4}'); do echo prune jobs client=$client jobtype=Backup yes | bconsole; done
prune volumes¶
for i in $(echo list volume | bconsole | awk '/pop-/{print $4}'); do echo purge yes volume=$i | bconsole; done
truncate¶
echo truncate yes volstatus=Purged | bconsole
PKI¶
install and copy¶
apt install easy-rsa
cp -rpv /usr/share/easy-rsa /etc/bareos/easy-rsa
Basic CA Config¶
cat >>/etc/bareos/easy-rsa/vars<EOF
export EASY_RSA="`pwd`"
export OPENSSL="openssl"
export PKCS11TOOL="pkcs11-tool"
export GREP="grep"
export KEY_CONFIG=`$EASY_RSA/whichopensslcnf $EASY_RSA`
export KEY_DIR="$EASY_RSA/keys"
export PKCS11_MODULE_PATH="dummy"
export PKCS11_PIN="dummy"
export KEY_SIZE=4096
export CA_EXPIRE=3650
export KEY_EXPIRE=3650
export KEY_COUNTRY="DE"
export KEY_PROVINCE="BY"
export KEY_CITY="Nuermberg"
export KEY_ORG="example AG"
export KEY_EMAIL="example@example.com"
export KEY_OU="MyOU"
export KEY_NAME="BareOS"
EOF
init ca¶
/etc/bareos/easy-rsa # source vars
/etc/bareos/easy-rsa # ./clean-all
/etc/bareos/easy-rsa # ./pkitool --initca
Using CA Common Name: example AG CA
Generating a 4096 bit RSA private key
............................................................++
.............................................................++
writing new private key to 'ca.key'
-----
create server cert¶
/etc/bareos/easy-rsa # source vars
/etc/bareos/easy-rsa # ./pkitool --server host1.example.com
Generating a 4096 bit RSA private key
.............................++
..................................++
writing new private key to 'host1.example.com.key'
-----
Using configuration from /etc/bareos/easy-rsa/openssl.cnf
Can't open /etc/bareos/easy-rsa/keys/index.txt.attr for reading, No such file or directory
139634891642112:error:02001002:system library:fopen:No such file or directory:../crypto/bio/bss_file.c:74:fopen('/etc/bareos/easy-rsa/keys/index.txt.attr','r')
139634891642112:error:2006D080:BIO routines:BIO_new_file:no such file:../crypto/bio/bss_file.c:81:
Check that the request matches the signature
Signature ok
The Subject's Distinguished Name is as follows
countryName :PRINTABLE:'DE'
stateOrProvinceName :PRINTABLE:'BY'
localityName :PRINTABLE:'Nuermberg'
organizationName :PRINTABLE:'example AG'
organizationalUnitName:PRINTABLE:'MyOU'
commonName :PRINTABLE:'host1.example.com'
name :PRINTABLE:'BareOS'
emailAddress :IA5STRING:'example@example.com'
Certificate is to be certified until May 12 08:18:55 2028 GMT (3650 days)
Write out database with 1 new entries
Data Base Updated
Last update:
May 2, 2020