backup
Backup
Backup your files using borg with different intervals and destinations.
Example output
DESTINATION: wd
home UP TO DATE (0 days ago at 2016-02-12 18:00)
system UP TO DATE (0 weeks ago at 2016-02-10 15:28)
media UP TO DATE (0 weeks ago at 2016-02-10 15:29)
DESTINATION: jokke (remote)
home needs backup (never executed)
system needs backup (never executed)
'home' (jokke) backup started
VPN connection already established
Connected to jokke-backup
[Borg output...]
'system' (jokke) backup started
VPN connection already established
Connected to jokke-backup
[Borg output...]
Don't forget to unmount!
Requirements
- Ruby
- Gem colorize (optional)
borg
pass
openvpn
notify-send
on remote backup server
Installation
- Clone this repo to
/tmp
- Install
borg
- Install
pass
- Install
openvpn
- Install gem:
gem install colorize
- Copy
backup
andbackup_lib.rb
to a directory which is added to$PATH
- For remote backups: Install
borg
on remote machine and addmessage_pong
to$PATH
for notifications about backup process - Change
BackupLib::HOME
inbackup_lib.rb
to your home path. Don't $HOME, because of running with sudo - Copy
config.yaml
to/etc/borg/config.yaml
- Make changes in
/etc/borg/config.yaml
- Add pass file
encryption/backup
viapass generate encryption/backup
mkdir /backup
- Copy
pre_backup.sh
to/backup/pre_backup.sh
and make changes - For remote backups: Configure remote destination in
$HOME/.ssh/config
# Backup with borg
# Start VPN /etc/openvpn/jokke.conf first
Host jokke-backup
User dsiw
HostName <ip>
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 22
# seconds
ConnectTimeout 3
I recommend using ssh-agent
and gpg-agent
.
First backup
- Show your current password via
echo $(pass show encryption/backup)
- Init all your repositories via
borg init ... $YOUR_BACKUP_DESTINATION_FOLDER_FROM_CONFIG/home
- Start
backup -n
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Repository
backup
Owner
Statistic
- 0
- 0
- 0
- 0
- 0
- over 6 years ago
- June 5, 2018
License
Links
Synced at
Fri, 22 Nov 2024 08:50:51 GMT
Languages