
*** Introduction ***

BSClient is a collection of scripts to make ease and efficient of IBCL's BackupSpace.

This is a short introduction to it's usage.


*** Configuration ***

cd /etc/bsclient

cp environment.template environment
cp dirs2backup.template dirs2backup
cp prep-steps.template prep-steps
cp post-steps.template post-steps

vi environment dirs2backup prep-steps post-steps


*** Test ssh connectivitiy, activate ***

1. Call bsc-testconnection

2. Have cron call bsc-daily once a night


*** Main Commands ***


* bsc-backup

Syncs the given directory (or file) to the configured backup space.


* bsc-daily
 
 1. executes all commands in /etc/bsclient/prep-steps
    and lists them with OK or FAILURE
 2. calls bsc-backup for all directories listed in /etc/bsclient/dirs2backup


* bsc-restore

Restores the given directory (or file) from the configured backup space.

Append -n for a dry run.

Append other rsync options as desired.


* bsc-testconnection

Tests the ssh connectivity and access configured in /etc/bsclient/environment.


*** Helper Commands ***


* bsc-aptget4updates

Updates package archive contents and detects if apt-get thinks there are 
updates to install.


* bsc-check4hdspace

Checks if any partition seems to be running full, i.e. has more than a 
certain usage. The satisfying usage percentage considered just not worth 
warning about is 90 and can be overwritten by just giving it as parameter, 
i.e. call check4hdspace 75 if you think everything above 75% is worth 
beeing warned about.


* bsc-mysql_dumpdb2file, bsc-postgres_dumpdb2file

Dumps a single mysql/mariadb/postgres DB, given as $1, efficiently to file.
Filename can be given as $2, defaults to $1.sql.gz
The filename suffixes .gz and .bz2 are respected by filtering the dump
output through gzip resp. bzip2.


* mysql_dump_dockerized_db2file, postgres_dump_dockerized_db2file

Same as above, for databases in docker containers.


* bsc-mysql_dumpdbs2dir, bsc-postgres_dumpdbs2dir

Dumps all mysql/mariadb/postgres DBs to the given directory, defaulting to /var/www/mysql.dumps


* mysql_dump_dockerized_dbs2dir, postgres_dump_dockerized_dbs2di

Same as above, for databases in docker containers.


* /usr/lib/bsclient/tar_etc

Tars /etc to /var/backup/etc/etc.tar.gz, maintaining 2 generations.
 

* bsc-yum4updates

Updates repositories' contents and detects if yum thinks there are updates 
to install.


