Backing up your Virtualizor VPS in Backblaze B2

If you are following news about cloud storage, you may know Backblaze B2 is one of the cheapest object storage providers, with prices almost 30% of what Amazon charges per GiB. This makes them an ideal solution for backup storage, since they also have CDNs in various countries, meaning they have high bandwidth. This is why we can provide free weekly backups on our VPS products!

How to use them to backup your VPS? Virtualizor is quite limited in its integrated backup options, so we used rclone wrapped in a very simple script, to provide a local FTP interface. There is no need whatsoever to pay for middlemen like Couchdrop to provide an easier interface to Backblaze.

To run rclone as an FTP server listening in your loopback for Virtualizor, you need to add an option for it to keep the directory cache for a lot longer than normal, or else your backups will fail. This is due to Virtualizor creating directories before uploading the backups, which may cause them to be dropped if no files are uploaded to them.

Run this as a service or just leave it running in background:

while true
  rclone -vv serve ftp backblaze:virtualizor0 --addr  --dir-cache-time 168h --b2-chunk-size 256M >> /var/log/rclone.log
  sleep 5

The critical option is “–dir-cache-time 168h”. Without it your backups will fail to upload.

Next configure an FTP backup plan in Virtualizor, everything should just work! Remember to use “anonymous:anonymous” as your user:password, or set it to anything you want in rclone.

Leave a Reply

Leave a Reply

Your email address will not be published. Required fields are marked *