Setting up a backup on B2 / DONE
https://www.backblaze.com/
Create an account in the system https://www.backblaze.com/
Activate B2 cloud storage for this: Log in to your account -> My Settings -> Enabled Products -> [+] B2 Cloud Storage

Create a basket where we will save:

ПAfter that we need to create an App key that can only make a record without the ability to delete the already created backup unfortunately it can not be done through the panel so we created a script that can create a secure key through API backblaze)
To do this we need to:
Clone repo:
cd /root/ git clone https://gitlab.com/BoxExchanger-public/b2-backups.gitGo to the project folder:
cd b2-backupsInstall Packages:
npm iGet Master KEY (must be changed after creation)

Create a key:
npm run new-keyB2 application key ID: keyID obtained in the previous step B2 application key: applicationKey obtained in the previous step
B2 buckets ID: Buckets -> Your bucket -> Bucket ID
Copy the obtained keys to install them on our server. (temporarily save them in a text file)

Recreate the key obtained at step 4.4 so that the old one is no longer available (it is no longer necessary to copy it)
Install rclone on the server.
Install the obtained keys on the server using the following commands:
rclone configNext, we will be asked to answer questions:
e/n/d/r/c/s/q> n name> b2 Storage> 5 account> (App Key Id c шага 4.6) key> (App Key c шага 4.6)Configure backup.sh to properly create the backup and notify the administrator.
cd /root/b2-backups nano backup.shConfiguring the block
# -- Configuration --# rclone remote name. RCLONE_REMOTE="b2" # b2 bucket name. B2_BUCKET="name-project" # Telegram Bot Token BOT_TOKEN="1234567890:ABCDEF1234567890ABCDEF1234567890ABC" # (list) of Telegram Chat IDs. # e.g: CHAT_IDS=("1234567890" "0987654321") CHAT_IDS=("1234567890")
8. Give permissions to run the bash-script file backup.sh
9. Check the work of the backup script
10. Set auto backup by crown (in the example every day at 4am server time usually GMT).
Last updated