Cloudbox Backup and Restore - dibrz/ARMBand GitHub Wiki


Intro

Backup and Restore is an integral part of Cloudbox, this is what makes it so great! Everything related to installed applications can be backed up.

Note 1: Torrent seeding content, anything in /mnt/, /home/, or anywhere else other than the /opt/ folder, will NOT be backed up (media files are moved to the cloud via Cloudplow, anyway).

Note 2: If you wish to move your Cloudbox to another server, see Migrating Cloudbox.


                         
Items Backed UP
     
Backed Up From
     
Restored To
App Data /opt/ /opt/
Account Settings ~/cloudbox/accounts.yml
Cloudbox Settings ~/cloudbox/settings.yml
Cloudbox Advanced Settings ~/cloudbox/adv_settings.yml
(Custom) Backup Excludes List ~/cloudbox/backup_excludes.txt
Rclone Config ~/.config/rclone/rclone.conf ~/.config/rclone/rclone.conf

Cloudbox Backup

Cloudbox Backup creates a backup tar file (cloudbox.tar) of the entire /opt folder, which includes all settings and configuration files for the Docker apps installed with Cloudbox, and uploads it to your Rclone or Rsync remote.

The files accounts.yml, settings.yml, adv_settings.yml, rclone.conf, and (if you had one) backup_excludes.txt are kept separately from the backup tar file.

Backup can be ran manually, for an immediate backup, or scheduled to run periodically.

Manual Backup

This is handy for times when you just need to make an immediate backup of your server, regardless of whether you have backup scheduler enabled or not.

  1. Go into your Cloudbox folder

    cd ~/cloudbox
  2. Make sure settings are filled out, see the here and here.

  3. Run the backup command

    sudo ansible-playbook cloudbox.yml --tags backup

Scheduled Backup

This will schedule Cloudbox backups to run periodically. This is set Cron.

There are 2 ways to set this up:

  1. Have Cloudbox setup it up for you, or

  2. Create a Cron task, manually.

Scheduling Backup via Cloudbox

  1. Make sure settings are filled out, see the here and here.

  2. Run a manual backup once:

    Note: This step is required even if scheduled backup was enabled (i.e. cron_state set to present) when you first installed Cloudbox, since a manual backup has to be run once to create the cron job.

    1. Go into your Cloudbox folder.

      cd ~/cloudbox
    2. Run the backup command.

      sudo ansible-playbook cloudbox.yml --tags backup

Scheduling Backup Manually via Cron

  1. Edit the crontab in root.

    sudo crontab -e
  2. To add in your cron task, you must use specify PATH variable and the full Ansible path (eg. PATH='/usr/bin:/bin:/usr/local/bin' /usr/local/bin/ansible-playbook /home/seed/cloudbox/cloudbox.yml --tags backup).

    Examples:

    Weekly (At Midnight Every Sunday):

    @weekly PATH='/usr/bin:/bin:/usr/local/bin' env ANSIBLE_CONFIG='/home/seed/cloudbox/ansible.cfg' '/usr/local/bin/ansible-playbook' '/home/seed/cloudbox/cloudbox.yml' --tags backup --skip-tags settings >> '/home/seed/logs/cloudbox_backup-'`date +\%Y-\%m-\%d_\%H-\%M-\%S`.log 2>&1
    

    At 6:00 AM Every Morning:

    0 6 * * * PATH='/usr/bin:/bin:/usr/local/bin' env ANSIBLE_CONFIG='/home/seed/cloudbox/ansible.cfg' '/usr/local/bin/ansible-playbook' '/home/seed/cloudbox/cloudbox.yml' --tags backup --skip-tags settings >> '/home/seed/logs/cloudbox_backup-'`date +\%Y-\%m-\%d_\%H-\%M-\%S`.log 2>&1
    

    Can find other examples at https://crontab.guru/ .

    Note: If you modify the one that Ansible creates automatically, you must remove the comment header (#Ansible: Backup Cloudbox), or else Ansible will reset it back to what settings.yml is set to.

Cloudbox Restore

Cloudbox Restore downloads the backup .tar file and and restores it to the /opt folder. This can be done on the same server or brand new one, with everything exactly as you left it at the time of backup.

Steps below assume you are restoring to a new / wiped server.

  1. Create a user account and login as that user.

  2. Install dependencies and download the Cloudbox project folder.

  3. Update the kernel (if required).

  4. Drop in the following files, into the ~/cloudbox folder:

    • accounts.yml

    • settings.yml

    • adv_settings.yml

    • rclone.conf

    • backup_exludes.txt (if you had a custom one)

    Note: These files were backed up separately from the cloudbox.tar file.

  5. Run the restore command (in ~/cloudbox).

    sudo ansible-playbook cloudbox.yml --tags restore
  6. Install Cloudbox / Mediabox / Feederbox.

  7. Install any extra containers you had previously.

After the install, everything should be like it was at the time of backup.

⚠️ **GitHub.com Fallback** ⚠️