Page 1 of 2
Backup Vesta to Backblaze B2
Posted: Fri Mar 29, 2019 4:56 pm
by rez0n
Hello, today I pushed
pull-request to the Vesta repository, and want to share what I was do.
Long time we wait to native cloud backups in Vesta, many "duct tape" was used in hack's. I was very liked Backblaze B2 service and pricing and understood - it will never add to the Vesta, so I'm accepted the challenge and created an implementation of native Vesta backups to the B2 service.
For now, you can use it and test with me. You need update 3 vesta files, source in
commit
Files to update: v-backup-user, v-delete-user-backup, v-restore-user
Create config file $VESTA/conf/b2.backup.conf contains
Code: Select all
BUCKET=<bucket_name>
B2_KEYID=<Application_Key_ID>
B2_KEY=<key>
Update Vesta config $VESTA/conf/vesta.conf BACKUP_SYSTEM (local,b2 or only b2)
And install python module b2
Ubuntu
Code: Select all
sudo apt install python-pip
sudo pip install b2
CentOS 7
Code: Select all
easy_install pip
pip install --upgrade setuptools --user python
pip install --upgrade --ignore-installed b2
Enjoy. Your feedback are welcome. Sorry for my English.
Re: Backup Vesta to Backblaze B2
Posted: Tue May 14, 2019 7:14 am
by zaqueon
Hello,
Thanks for publishing your script.
I followed the instructions. But at the end of the backup, I miss this error.
Code: Select all
-- SUMMARY --
ERROR: Missing account data: 'NoneType' object has no attribute '__getitem__' Use: b2 authorize-account
2019-05-14 09:12:58 Uploading admin/admin.2019-05-14_09-12-56.tar ...
Error: b2 failed to upload admin.2019-05-14_09-12-56.tar
Re: Backup Vesta to Backblaze B2
Posted: Wed May 15, 2019 1:29 pm
by rez0n
Hi, seems something wrong with yours $VESTA/conf/b2.backup.conf
You pasted data without "<" and ">"? If yes - show please your config file (blur or change keys to random)
Re: Backup Vesta to Backblaze B2
Posted: Wed May 15, 2019 3:16 pm
by zaqueon
rez0n wrote: ↑Wed May 15, 2019 1:29 pm
Hi, seems something wrong with yours $VESTA/conf/b2.backup.conf
You pasted data without "<" and ">"? If yes - show please your config file (blur or change keys to random)
This is what I have written in /usr/local/vesta/conf/b2.backup.conf
(I changed the real data by "x")
Code: Select all
BUCKET='xxxxxxx'
B2_KEYID='xxxxxxxxxx'
B2_KEY='xxxxxxxxxxxxxxxxxxxxxxxx'
I have extracted the data from the places I indicate in this image:
Re: Backup Vesta to Backblaze B2
Posted: Wed May 15, 2019 3:22 pm
by rez0n
Try to remove '
My config
Code: Select all
BUCKET=xxxxx
B2_KEYID=001exxxxxe59xxxx776xxxxxx005
B2_KEY=Kxxxxxzz+x9s7xxxxxxxxxadcxxxxxyQ
Re: Backup Vesta to Backblaze B2
Posted: Wed May 15, 2019 4:23 pm
by zaqueon
I get the same error:
Code: Select all
ERROR: Missing account data: 'NoneType' object has no attribute '__getitem__' Use: b2 authorize-account
2019-05-15 18:22:15 Uploading admin/admin.2019-05-15_18-22-13.tar ...
Error: b2 failed to upload admin.2019-05-15_18-22-13.tar
It is a test server. If you want, I can send you ssh access privately. This way you can debug your script.
Re: Backup Vesta to Backblaze B2
Posted: Wed May 15, 2019 8:36 pm
by rez0n
Yes, lets try, send me access into pm.
Seems script can't find 'b2' by 'which b2' command.
Re: Backup Vesta to Backblaze B2
Posted: Thu May 16, 2019 1:39 pm
by rez0n
Fixed, problem on the screenshot :)
b2.backup.conf -
https://take.ms/IiQEg
Re: Backup Vesta to Backblaze B2
Posted: Thu May 16, 2019 1:50 pm
by rez0n
One more thing.
I figured out, on one my server with enabled Vesta autoupdates - file v-backup-users reseted to defauls (vesta updating? lol)
To prevent this, you can add something like this to cron
Code: Select all
curl https://raw.githubusercontent.com/serghey-rodin/vesta/6eac107be29827a1c18ae16e19def9dcb6af0bcb/bin/v-backup-user -o /usr/local/vesta/bin/v-backup-user
curl https://raw.githubusercontent.com/serghey-rodin/vesta/6eac107be29827a1c18ae16e19def9dcb6af0bcb/bin/v-delete-user-backup -o /usr/local/vesta/bin/v-delete-user-backup
curl https://raw.githubusercontent.com/serghey-rodin/vesta/6eac107be29827a1c18ae16e19def9dcb6af0bcb/bin/v-restore-user -o /usr/local/vesta/bin/v-restore-user
Re: Backup Vesta to Backblaze B2
Posted: Thu May 16, 2019 3:01 pm
by zaqueon
It works perfectly. I'm going to use it on all my servers. The alternative was to use a very heavy software such as Rclone.
I have not understood the screenshot solution. Is it possible that it is because I use sublimetext instead of vi to edit files?