simple stupid backup tool
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Bernhard Fröhlich 9c00da8e3b
Initial commit
10 months ago
lib Initial commit 10 months ago
rc.d Initial commit 10 months ago
LICENSE Initial commit 10 months ago
Makefile Initial commit 10 months ago
README.md Initial commit 10 months ago
ssbt Initial commit 10 months ago

README.md

ssbt (Simple Stupid Backup Tool)

You create a backup on your machine and ssbt will periodically collect and archive it.

  • Simple (no database, just filesystem and a config)
  • Secure (using chrooted sftp)
  • Archive old backups
  • First class FreeBSD support

But why yet another backup solution?

Backups should be simple and reliable to make sure they are as painless as possible. I know there are a lot of tools out there with fancy webinterfaces, agents for whatever service you might run, multiuser, cross platform and much more. You will not find any of those features here.

What you will find is a simple shellscript which will periodically log into your machines with sftp(1) and pull tar archives from there which get archived.

You can continue to create your backups with tar(1) and be sure those are archived on your backup master.

Quick-Start

Client

A account is needed which will be used by the master to login and fetch the backups. It is recommended to create a separate account with a separate SSH certificate. This account can also be limited to only allow sftp to reduce the risk.

This example assumes that you backup to /backup/data but this can be any directory.

# adduser -d "" -D -s nologin -w no
Username: backup
Full name: 
Uid (Leave empty for default): 
Login group [backup]: 
Login group is backup. Invite backup into other groups? []: 
Login class [default]: 
Shell (sh csh tcsh nologin) [nologin]: 
Home directory [/backup]: 
Home directory permissions (Leave empty for default): 
Use password-based authentication? [no]: 
Lock out the account after creation? [no]: 
Username   : backup
Password   : <disabled>
Full Name  : 
Uid        : 1001
Class      : 
Groups     : backup 
Home       : /backup
Home Mode  : 
Shell      : /usr/sbin/nologin
Locked     : no
OK? (yes/no): yes
adduser: INFO: Successfully added (backup) to the user database.
Add another user? (yes/no): no
Goodbye!

# mkdir -m 0755 /backup
# install -d -m 0700 -g backup -o backup /backup/.ssh
# install -d -m 0700 -g backup -o backup /backup/data

# install -m 0400 -g backup -o backup /dev/null /backup/.ssh/authorized_keys
# echo "...your-public-key-here..." > /backup/.ssh/autorized_keys

# printf "\nMatch User backup\n" >> /etc/ssh/sshd_config
# printf "\tChrootDirectory %%h\n" >> /etc/ssh/sshd_config
# printf "\tForceCommand internal-sftp\n" >> /etc/ssh/sshd_config
# printf "\tX11Forwarding no" >> /etc/ssh/sshd_config

# /etc/rc.d/sshd reload

Backup master