Poor Man’s Backup

Introduction

We’re basically setting up a crontab with two parts:

an alternative would be to use rsync remotely from a dedicated backup host.

Local backup & upload

Fetch the script templates as root,

cd ~/
mkdir -p bin/
cd bin/

wget http://doc.nethence.com/download/poor-man/backup.ksh
wget http://doc.nethence.com/download/download/poor-man/backup.lst
wget http://doc.nethence.com/download/download/poor-man/backup.upload.ksh

chmod +x backup.ksh backup.upload.ksh

Tune what folders you want to backup,

vi backup.lst

Tune your FTP server/login/pass,

vi backup.upload.ksh

Enable the shit every night as root,

mkdir /data/backup/

crontab -e

0 3 * * * time nice /root/bin/backup.ksh && echo && time nice /root/bin/backup.upload.ksh

Dedibackup & Encryption

Regarding the FTP backup service at dedibox, this does the trick (note the , and absence of a password afterwards), as long as you enable autologin

lftp -u auto, DEDIBACKUP_SERVER_ADDRESS

https://documentation.online.net/en/dedicated-server/tutorials/backup/dedibackup

Encrypt your backups

gpg --version # v1 is fine
gpg --no-use-agent --symmetric --passphrase 'KEY_HERE' -o backup.tar.gz
#--encrypt

Alternatives

So we have covered tar/ftp here, Rsync and Borg. Here some alternatives

Resources

https://ubuntuforums.org/showthread.php?t=1420156 https://stackoverflow.com/questions/9460140/gpg-encrypt-file-without-keyboard-interaction https://unix.stackexchange.com/questions/400772/how-can-i-automate-gpg-decryption-which-uses-a-passphrase-while-keeping-it-secre https://askubuntu.com/questions/95920/encrypt-tar-gz-file-on-create https://superuser.com/questions/162624/how-to-password-protect-gzip-files-on-the-command-line https://www.tecmint.com/encrypt-decrypt-files-tar-openssl-linux/

duplicity https://www.digitalocean.com/community/tutorials/how-to-use-duplicity-with-gpg-to-securely-automate-backups-on-ubuntu


Nethence | Doc | Pub | Lab | Pbraun | SNE Russia | xhtml