This script is used by the official brightid nodes to upload daily backups to the google storage service. Other nodes that want to join the network restore the last backup to reach the state of the backup time. Nodes read the operations sent after the backup time from the blockchain and apply them to sync to the current state of the network.
Latest BrightID backup can always be downloaded from:
https://storage.googleapis.com/brightid-backups/brightid.tar.gz
Available backup files can be found:
https://storage.googleapis.com/brightid-backups/
There are backup files avilable for following times:
- one file per hour for a day
- one file per day for a week
- one file per week for a month
- one file per month forever
- python3
- pip3
- arangodump
- You can find out how to install
arangodumpfrom arango client tools on your os from here.
pip3 install -r requirements.txt
-
Place your google credentials json file beside the
backup.pywith thegoogle.jsonas name. -
Add a cron job to run the script every hour.
# m h dom mon dow command
0 * * * * cd /home/as/BrightID-Node-Backup-Script && python3 backup.py >> /var/log/brightid_backup.log 2>&1
- Give permissions to the log file to the user running the cron.
sudo su -
touch /var/log/brightid_backup.log
chown as:as /var/log/brightid_backup.log
- Create /etc/logrotate.d/brightid-backup to keep logs from getting too big.
/var/log/brightid_backup.log {
daily
rotate 7
compress
missingok
notifempty
copytruncate
}