Backup and Restore is an integral part of Cloudbox, this is what makes it so great! Everything related to installed applications is backed up.
Note: 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 Google Drive via [[UnionFS Cleaner]], anyway).
Cloudbox Backup creates a backup .tar file of the entire /opt
folder, which includes all settings and configuration files for the Docker apps installed with Cloudbox, and uploads it to your Google Drive or Rsync remote. Backup can be ran manually for an immediate backup or scheduled to run periodically.
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.
Note: If you wish to move your Cloudbox to another server, see [[Migrating Cloudbox]].
Backed Up From | Restored To | |
---|---|---|
Plex | /opt/plex/ |
/opt/plex/ |
PlexPy | /opt/plexpy/ |
/opt/plexpy/ |
Plex Requests - Meteor | /opt/plexrequests/ |
/opt/plexrequests/ |
Sonarr | /opt/sonarr/ |
/opt/sonarr/ |
Radarr | /opt/radarr/ |
/opt/radarr/ |
NZBGet | /opt/nzbget/ |
/opt/nzbget/ |
Rutorrent/rTorrent | /opt/rutorrent/ |
/opt/rutorrent/ |
NZB Hydra | /opt/nzbhydra/ |
/opt/nzbhydra/ |
Jackett | /opt/jackett/ |
/opt/jackett/ |
Portainer | /opt/portainer/ |
/opt/portainer/ |
Organizr | /opt/organizr/ |
/opt/organizr/ |
Nginx Proxy | /opt/nginx-proxy/ |
/opt/nginx-proxy/ |
SSL Certificates | /opt/nginx-proxy/ |
/opt/nginx-proxy/ |
Plex Autoscan | /opt/plex_autoscan/ |
/opt/plex_autoscan/ |
Unionfs Cleaner | /opt/unionfs_cleaner/ |
/opt/unionfs_cleaner/ |
Systemd Service | /etc/systemd/system/ |
/opt//opt/systemd-backup/ |
Cloudbox settings | ~/cloudbox/settings.yml |
|
Rclone config | ~/.config/rclone/rclone.conf |
~/.config/rclone/rclone.conf |
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.
-
Go into your Cloudbox folder
cd ~/cloudbox
-
Set the following in your [[settings.yml|First Time Install: Configuring Settings]] file:
-
tar_dest
(default:/home/{{user}}/Backups
) -
Decide on Rclone or Rsync as your backup method.
-
If you prefer to use Rclone, set
use_rclone
totrue
and define anrclone_dest
(default:google:/Backups
).- Note: If you have a separate Plex and Feeder setup, you may want to separate your backups into different folders (e.g.
google:/Backups/Plexbox
for your Plexbox andgoogle:/Backups/Feederbox
for your Feederbox)
- Note: If you have a separate Plex and Feeder setup, you may want to separate your backups into different folders (e.g.
-
If you prefer to use Rsync, set
use_rsync
totrue
and define anrsync_dest
(default:rsync://somehost.com/Backups
; you can use the Rsync protocol or a folder path). -
Note: If both
use_rclone
anduse_rsync
are set totrue
, backups will be made to both locations, but only Rclone will be used to retrieve the backup file during restore (i.e. Rclone will take priority over Rsync during restores).
-
Note: See the [[Configuring Settings | First Time Install: Configuring Settings]] wiki page for further details on all the settings listed above.
-
-
Run the backup command
sudo ansible-playbook cloudbox.yml --tags backup
This will schedule Cloudbox backups to run periodically. This is set Cron.
There are 2 ways to set this up:
-
Set the following in your [[settings.yml|First Time Install: Configuring Settings]] file:
-
tar_dest
(default:/home/{{user}}/Backups
) -
Decide on Rclone or Rsync as your backup method.
-
If you prefer to use Rclone, set
use_rclone
totrue
and define anrclone_dest
(default:google:/Backups
).- Note: If you have a separate Plex and Feeder setup, you may want to separate your backups into different folders (e.g.
google:/Backups/Plexbox
for your Plexbox andgoogle:/Backups/Feederbox
for your Feederbox)
- Note: If you have a separate Plex and Feeder setup, you may want to separate your backups into different folders (e.g.
-
If you prefer to use Rsync, set
use_rsync
totrue
and define anrsync_dest
(default:rsync://somehost.com/Backups
; you can use the Rsync protocol or a folder path). -
Note: If both
use_rclone
anduse_rsync
are set totrue
, backups will be made to both locations, but only Rclone will be used to retrieve the backup file during restore (i.e. Rclone will take priority over Rsync during restores).
-
-
cron_time
(schedule to of your preference) -
cron_state
topresent
-
pushover_app_token
andpushover_user_key
if you wish to receive [[Pushover]] notifications during backup tasks.
Note: See the [[Configuring Settings | First Time Install: Configuring Settings]] wiki page for further details on all the settings listed above.
-
-
Run a Manual Backup Once
Note: This step is required even if scheduled backup was enabled (i.e.
cron_state
set topresent
) when you first installed Cloudbox, since a manual backup has to be run once to create the cron job.-
Go into your Cloudbox folder.
cd ~/cloudbox
-
Run the backup command.
sudo ansible-playbook cloudbox.yml --tags backup
-
-
Edit the crontab in root.
sudo crontab -e
-
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 PATH='/usr/bin:/bin:/usr/local/bin' /usr/local/bin/ansible-playbook /home/seed/cloudbox/cloudbox.yml --tags backup >> /home/seed/logs/cloudbox_backup-`date +\%Y-\%m-\%d_\%H-\%M-\%S`.log 2>&1
0 6 * * * PATH='/usr/bin:/bin:/usr/local/bin' /usr/local/bin/ansible-playbook /home/seed/cloudbox/cloudbox.yml --tags backup >> /home/seed/logs/cloudbox_backup-`date +\%Y-\%m-\%d_\%H-\%M-\%S`.log 2>&1
Note: If you modify the one that Ansible creates, you must remove the comment header (
#Ansible: Backup Cloudbox
), or else Ansible will reset it back to whatsettings.yml
is set to.
We will assume you are restoring to a new / clean server.
-
[[Download Cloudbox|First Time Install: Downloading Cloudbox]] (all steps within).
-
[[Update the kernel|First Time Install: Updating-Kernel]].
-
Set the following in your [[settings.yml|First Time Install: Configuring Settings]] file (the bare minimum for a restore):
-
user
(based on the user account you created in step #1) -
tar_dest
(default:/home/{{user}}/Backups
) -
Decide on Rclone or Rsync as your backup method.
-
If you prefer to use Rclone, set
use_rclone
totrue
and define anrclone_dest
(default:google:/Backups
).- Note: If you have a separate Plex and Feeder setup, you may want to separate your backups into different folders (e.g.
google:/Backups/Plexbox
for your Plexbox andgoogle:/Backups/Feederbox
for your Feederbox)
- Note: If you have a separate Plex and Feeder setup, you may want to separate your backups into different folders (e.g.
-
If you prefer to use Rsync, set
use_rsync
totrue
and define anrsync_dest
(default:rsync://somehost.com/Backups
; you can use the Rsync protocol or a folder path). -
Note: If both
use_rclone
anduse_rsync
are set totrue
, backups will be made to both locations, but only Rclone will be used to retrieve the backup file during restore (i.e. Rclone will take priority over Rsync during restores).
-
Note: See the [[Configuring Settings | First Time Install: Configuring Settings]] wiki page for further details on all the settings listed above.
-
-
Upload a copy of your rclone.conf file into
~/cloudbox/
.- You can do this via sftp/scp or by running
nano ~/cloudbox/rclone.conf
and pasting the contents of your rclone.conf.
- You can do this via sftp/scp or by running
-
Run the restore command (in
~/cloudbox
).sudo ansible-playbook cloudbox.yml --tags restore
-
Configure the rest of your [[settings.yml|First Time Install: Configuring Settings]].
Note: You may use your previous settings.yml file (
/opt/settings.yml
) as a point of reference to update your new one. However, if all the variables are the same (i.e. no new or modified variables), you may just replace it with your previous one (cp /opt/settings.yml ~/cloudbox/
). -
[[Install Cloudbox| First Time Install: Installing Cloudbox]].
After install, everything will be as it was at the time of backup.