4 01. Installation
Asif Bacchus edited this page 2019-07-20 19:42:29 -06:00

installation

There is nothing to install. Simply clone this repo, copy the script and config files to a suitable location, customize and you're good to go. Things are easier if you do everything as your root user. The following examples will assume that is the case.

# switch to root user
sudo -s
# change to root directory
cd /root
# clone the repo and change to that directory
git clone https://git.asifbacchus.app/asif/seafileBackup.git
cd seafileBackup
# ensure the script is executable
chmod +x seafbackup.sh

run as root

Please note that this script requires that you run it as root. Why? Very simply, this ensures that permissions issues do not prevent any of your files from being backed up!

configure everything (seafbackup.details)

All configuration details are stored in the seafbackup.details file. This file does contain sensitive information, so make sure you've set permissions properly to prevent anyone other than root from accessing it.

chown root:root seafbackup.details
chmod 600 seafbackup.details

The seafbackup.details file is completely annotated so you should have no problems updating parameters. Assuming default Seafile and borgbackup installations, you shouldn't have to change very much in this file. At a minimum, however, you will have to update the following parameters:

  • sqlPass: the password SEAFILE uses to access it's SQL databases
  • borgSSHKey: path to the SSH key file used to access your backup provider
  • borgConnectRepo: the unified username@url:reponame used to access your backup provider
  • borgRepoPassphrase: the passphrase used to access your remote borg repo

Note about SSH key

If you are planning on executing this script via cron or some other form of automation, it is highly recommended that you use an SSH key without a password! SSH is designed such that passwords cannot simply be passed to it via environment variables, etc. so this is something not easily automated for security reasons. As such, your computer will sit and wait for you to enter the password and will NOT execute the actual backup portion of the script until the SSH key password is provided.

If you really want/need to use an SSH key password, you will have to look into somethign like GNOME keyring or SSH-agent to provide a secure automated way to provide that password to SSH and allow this script to continue.

In practice, SSH keys without passwords are still quite safe since the key must still be known in order to connect and most keys are quite long. In addition, they key only connects to the remote server, your actual information within the borg repository is still encrypted and secured with both a key and password.


That's everything you need in terms of setup. Keep reading for script parameters.