Backup to Backblaze B2

I have been trying to configure Bacula to backup to Backblaze B2 and finally giving up. What is the preferred method to backup to Backblaze B2 (or any cloud provider for that matter)? I found the duplicity 3rd party project that is linked on your docs but the code hasn’t been updated in over 2 years. It mentioned you was going to make it an add-in. Is duplicity still the recommendation? Bacula is just backing up locally, obviously relying on local backups is not smart.

Anything that copies shadow/ + info/. I’d recommend doing a host-level backup with your provider, which ensures atomicity of the backup. If you need to grab files from a snapshot, then deploy the full image to a new VM, grab necessary files, then delete the VM. It would only cost a few pennies to deploy with the least headache.

I am working on using Restic, however I am having issues dumping the mysql backups. Using “/usr/bin/apnscp_php /usr/local/apnscp/bin/scripts/backup_dbs.php” doesn’t return any output and is instant (also tried --force). Where should the mysql dump files be going to? I’ve tried this on my servers that have ApisCP installed and it does the same time.

Run as env DEBUG=1 /usr/bin/apnscp_php /usr/local/apnscp/bin/scripts/backup_dbs.php

Backups are located in the site administrator’s home directory under mysql_backups/.

image

Only the manual backups I did are showing in the folder.

Backups follow rules. If a backup has generated, it won’t overwrite the existing backup unless --force is used. Looks like your backup periodicity is 2-3 days. For example,

# ls -la /home/virtual/benchmark.test/home/benchmark-user/mysql_backups/
total 24
drwx------ 2 admin2 admin2    96 Apr 23 23:05 .
drwx------ 7 admin2 admin2   250 Apr 23 23:05 ..
-rw------- 1 admin2 admin2 14213 Apr 23 23:05 benc_benchmarktest-20240424030416.zip
-rw------- 1 admin2 admin2  7437 Apr 23 23:05 mech_mechanicalcom-20240424030416.zip
# ./backup_dbs.php
DEBUG  : Purging up to 2 backups on site1
DEBUG  : Backing up `mech_foomechanicalcom'
DEBUG  : Purging up to 2 backups on site1
DEBUG  : Backing up `mech_mechanicalcom'
DEBUG  : Purging up to 2 backups on site1
# ls -la /home/virtual/benchmark.test/home/benchmark-user/mysql_backups/
total 48
drwx------ 2 admin2 admin2   186 Apr 25 19:46 .
drwx------ 7 admin2 admin2   250 Apr 23 23:05 ..
-rw------- 1 admin2 admin2 14213 Apr 23 23:05 benc_benchmarktest-20240424030416.zip
-rw------- 1 admin2 admin2 14253 Apr 25 19:46 benc_benchmarktest-20240425110435.zip
-rw------- 1 admin2 admin2  7437 Apr 23 23:05 mech_mechanicalcom-20240424030416.zip
-rw------- 1 admin2 admin2  7437 Apr 25 19:46 mech_mechanicalcom-20240425110435.zip

To determine the backup rules, cpcmd -d siteXX mysql:list-backups

# cpcmd -d site1 mysql:list-backups
mech_foomechanicalcom:
  span: '5'
  hold: '2'
  next: '1712030400'
  extension: zip
  email: null
mech_mechanicalcom:
  span: '5'
  hold: '2'
  next: '1711684800'
  extension: zip
  email: null

Periodicity is appropriate given the span. To override this, use --force

drwx------ 2 admin2 admin2   276 Apr 25 19:49 .
drwx------ 7 admin2 admin2   250 Apr 23 23:05 ..
-rw------- 1 admin2 admin2 14213 Apr 23 23:05 benc_benchmarktest-20240424030416.zip
-rw------- 1 admin2 admin2 14254 Apr 25 19:49 benc_benchmarktest-20240425110409.zip
-rw------- 1 admin2 admin2 14253 Apr 25 19:46 benc_benchmarktest-20240425110435.zip
-rw------- 1 admin2 admin2  7437 Apr 23 23:05 mech_mechanicalcom-20240424030416.zip
-rw------- 1 admin2 admin2  7437 Apr 25 19:49 mech_mechanicalcom-20240425110409.zip
-rw------- 1 admin2 admin2  7437 Apr 25 19:46 mech_mechanicalcom-20240425110435.zip

Note, in doing so you override the preferred backup preferences.