wiki:Crin3

Version 5 (modified by chris, 3 years ago) (diff)

--

Crin3

This is a 512M RAM Debian Stretch server for running S3QL and doing backups, it was installed on see ticket:11. This server has the other 3 servers, Crin1, Crin2 and Crin4 mounted via SSHFS and it backups up selected directories using S3QL to Advania.

Retrieving backups

If you need to restore a file or database from backups first mount the SQ3L filesystem for the specific server, for example:

sudo -i
mnt-s3ql crin1

This will mount the backups at /media/s3ql/crin1 and you can then cd to the directory and list the backups, for example:

cd /media/s3ql/crin1
ls -lah
  total 0
  drwxr-xr-x 1 root root 0 Jul 23 12:18 2015-07-23_12:18:42
  drwxr-xr-x 1 root root 0 Jul 23 12:30 2015-07-23_12:22:12
  drwx------ 1 root root 0 Jul 23 09:58 lost+found

Database backups can be found in /var/backups/mysql/databases on Crin1, they are produced by the wiki:DumpMysqlTables#backup-mysql script.

Backup process

There is a root crontab which runs the backups each night:

# m h  dom mon dow   command
01 01 * * * umnt-s3ql crin1 ; mnt-sshfs crin1 ; s3ql_backup crin1
01 02 * * * umnt-s3ql crin2 ; mnt-sshfs crin2 ; s3ql_backup crin2
01 03 * * * umnt-s3ql crin4 ; mnt-sshfs crin4 ; s3ql_backup crin4

First the S3QL file system is unmounted and checked (in case it has been manually mounted during the day) via wiki:S3QLMnt#unmnt-s3ql, then the remote server is mounted via SSHFS using wiki:SshfsMnt#mnt-sshfs and then the backup is run using a modified version of the S3QL backup script, wiki:S3QLBackup#s3ql_backup, this reads files with lists of directories to backup from /etc/s3ql/ and calls the expire_backups script to delete old backups.

The contents of the files in /etc/s3ql:

crin1

/usr/local
/etc
/home
/root
/var/backups
/var/www
/var/spool/cron/crontabs

crin2

/root
/etc
/home
/var/www
/var/backups
/usr/local
/var/spool/cron/crontabs

crin4

/home
/etc
/root
/var/www
/usr/local
/var/spool/cron/crontabs