Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backing up and restoring individual app directories #66

Open
vpatel9202 opened this issue Apr 4, 2022 · 5 comments
Open

Backing up and restoring individual app directories #66

vpatel9202 opened this issue Apr 4, 2022 · 5 comments

Comments

@vpatel9202
Copy link


Describe the problem
There are certain use cases where it would make sense to back up only a given app rather than running a full backup. For example, I have thumbnails enabled for Plex so my plex directory is absolutely massive relative to the rest of my apps. I'm okay with the compromise of less frequent backups for my Plex directory in order to maintain the thumbnails, but I don't want the rest of my apps to be beholden to the same less-frequent backup settings.

On the other hand, there are times when an app will fail for whatever reason and I want to restore only that specific app from a backup. The only way to do this currently is to manually download the tar for that app and replace the current app directory with the download.

Describe any solutions you think might work
The way I would imagine this working would be via a command such as sb backup plex which would then only backup /opt/plex. Similarly sb restore plex would pull the most recent archived version of the directory and replace the current directory. Allowing users to select which backup to restore from if multiple archived versions exist may be more difficult since I'm not sure there's anyway for Ansible to list available backups by date and have you select one.

Utilizing the automated backups on an app-by-app basis would be more difficult but a reworked backup_config.yml sample below shows one possibility. In this configuration, a complete backup of all apps would occur monthly, while a partial backup of some key apps occurs more frequently.

backup:
  local:
    enable: true
    destination: /mnt/local/Backups/Saltbox
  rclone:
    enable: true
    destination: google:/Backups/Saltbox
  rsync:
    enable: false
    destination: rsync://somehost.com/Backups/Saltbox
    port: 22
  restore_service:
    user: # 
    pass: # 
  misc:
    snapshot: true # 
  cron:
    full_backup:
      enable: true
      cron_time: monthly
    partial_backup:
      enable: true
      include:
        - radarr   # or /opt/radarr
        - sonarr   # or /opt/sonarr
        - prowlarr # or /opt/prowloarr
        - nzbget   # or /opt/nzbget
      cron_time: weekly

Additionally, partial backups would make even more sense for people who are not using btrfs as they would be able to backup their lighter apps quickly with little downtime and save the big stuff for a better time.

@saltydk
Copy link
Member

saltydk commented Apr 4, 2022

Just use btrfs on the /opt partition and most of this isn't a problem. Frankly this seems like overengineering a solution to combat bad system setup that potentially could have plenty of downsides on the support side of things for years to come.

If you want to do a Pull Request for a separate Backup role that does all this then by all means submit one but I don't see much benefit to doing this outside of maybe adding the individual app restore bit at some point but outside of that I will likely not want to go this route.

Duplicacy (incremental backups) would probably solve the issue with big app data folders so if we improve upon backup/restore that is likely the way we'll go instead of a complicated filtering solution which will likely need a complete rewrite as well but without giving more than a handful of users any benefits.

@chazlarson
Copy link
Collaborator

Some of this could be implemented with no code changes by adding a script that swapped in relevant backup_excludes.txt files on a schedule.

@saltydk
Copy link
Member

saltydk commented Apr 4, 2022

If we ignore how restore would work, sure.

@chazlarson
Copy link
Collaborator

Yeah, I was mostly thinking of the "only back plex up once a week" part.

@vpatel9202
Copy link
Author

@saltydk incremental backups would absolutely solve the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants