Skip to content

benzerbett/backupservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BackupService

This is a simple solution to push the contents of a specified folder to respective Minio buckets with similar names.

I used the latest version of Golang (1.18 as of writing this), so you may need to refactor accordingly.

Disclosure

This repo uses some experimental features in Go 1.18. This is the slices package using generics on 1.18. For further info, please refer to https://pkg.go.dev/golang.org/x/exp/slices

Set-up

  • Clone this repo
      git clone https://github.com/benzerbett/backupservice
  • Install dependencies
        cd backupservice
        go get
  • Set up environment variables. The variables are:
    • MINIO_ENDPOINT
    • MINIO_ACCESSKEY
    • MINIO_SECRET
    • BACKUP_FILES_DIR
        nano .env
  • To test it locally, simply run the main.go file
   go run main.go
  • Build & deploy
   go build -o backupservice

To deploy, you can schedule this as a cron job or otherwise, depending on your environment.

TODO

  • Decouple & clean up the string comparisons to match container names. Perhaps a mapping config?
  • Better logging (logrus?)
  • Refactor to use standard Go library, (remove experimental 1.18 slices feature)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages