wiki:Crin3

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.

SSH Fingerprints

These were produced using the SshFingerprints script:

1024 SHA256:MhmEY5TR0WWEdhAxtfi9b1e2Wrnj5ekeAOXjFbuein4 root@CRIN3 (DSA)
256 SHA256:Mqs3JBGtHeUL/5WywxqhDNpMcHG2s2ny5yldMLh3i7Q root@CRIN3 (ECDSA)
256 SHA256:mFH+00d5tCueuoD2Jrdll7PmP3vgtIzmjsvnosGAn14 root@CRIN3 (ED25519)
2048 SHA256:oybFehrgVMON4p62K6Zjg3pJ6wkCL9LzvTr0iEI01cg root@CRIN3 (RSA)

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.

To copy files back to one of the other servers you can take advantage of the fact that they are mounted via SSHFS on Crin4, and if they are not it is easy to mount them, for example:

sudo -i
mnt-sshfs crin1

Will mount the whole of the Crin1 server at /media/crin1 so retrieved files can be copied directly to the server.

Once you have finished retrieving backup you can unmount the filesystem:

umnt-s3ql crin1

Backup process

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

# m h  dom mon dow   command
01 01 * * * /usr/local/bin/s3ql_backup crin1 
02 03 * * * /usr/local/bin/s3ql_backup crin2 
03 05 * * * /usr/local/bin/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
Last modified 2 years ago Last modified on Sep 14, 2016, 1:33:52 PM