Skip to content

Backups: Copy all Sia files to a backup location

Ivaylo Novakov requested to merge ivo/gc_backups_dir into master

MERGE REQUEST

MR Guidelines

Overview

This MR addresses the first point of #4289 - copying Sia files to a backup location.

A copy of the task description, for convenience:

1. Copy backups to /backups/

The first step is to create a new /backups/<backupname> a.k.a the backup folder folder every time we create a backup. The folder itself contains all of the siafiles that go into the backup. So basically the contents of /home/user.

The backup folder also contains a .info file which serves 2 purposes.

  1. it replaces the renter.persist.UploadedBackups field since we can now store the UploadedBackup struct in the backup folder directly
  2. it is written after the backup was created successfully and is therefore an indication of creating a backup successfully. This allows us to loop over the backup folders on startup and delete the ones without the .info file since they weren't created successfully.

Example for Visual Changes

Checklist

Review and complete the checklist to ensure that the MR is complete before assigned to an approver.

  • All new methods or updated methods have clear docstrings
  • Testing added or updated for new methods
  • Any new packages are added to Makefile and .gitlab-ci.yml
  • API documentation updated for API updates
  • Module README.md updated for changes to workflow
  • Issue added to Sia-UI repo for new supporting features
  • Changelog File Created

Issues Closed

Part of #4289

Edited by Ivaylo Novakov

Merge request reports