Categorygithub.com/mattgiltaji/validatebackups
modulepackage
0.0.0-20241001030305-27de3e919646
Repository: https://github.com/mattgiltaji/validatebackups.git
Documentation: pkg.go.dev

# README

validatebackups

Validates some personal google cloud backups

Build Status Build status Coverage Status Go Report Card LICENSE

This utility is intended to download a sample of random files from backup locations. These files can then be manually verified to make sure the backups are working.

This is a port of my Python script of the same name to Go, fixing some bugs and design issues along the way.

High level procedure

  • Connect to google cloud storage
  • Run validation procedure for known buckets
  • These validation procedures are similar but not identical
  • Download files that need to be manually validated
  • Report success/failure for each bucket

Things to be addressed

  • Python script needs to be restarted from the beginning if a download fails partway through.
    • Catch a failing download partway through and just restart for that file.
      • This utility retries each failed download a configurable number of times
    • Serialize progress somehow so restarting the utility resumes from where it left off.
      • This utility skips already downloaded files and restart from the next file in sequence instead of the beginning all over again.
  • Python script's unit test suite runs integration tests that depend on accessing google cloud.
    • Go's mocking couldn't quite handle abstracting this away, so we connect to google cloud too ¯\(ツ)

# Structs

BucketAndFiles represents a mapping between a bucket and all the files for it to be downloaded for manual verification.
BucketToProcess is a mapping of bucket names toa type indicating how they should be validated.
Config represents the configuration options available.
FileDownloadRules contains parameters to adjust how many files get downloaded for manual verifications across different bucket types.
ServerFileValidationRules contains parameters to adjust validations on server-backup type buckets.