cayohollanda / aws-golang-backup

A Golang script created for backup of archives to AWS S3.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AWS Golang Backup Script

A Golang script created for backup of archives to AWS S3.

Usage

cayohollanda@pc:~$ aws-backup -b bucket-name -p /folder/to/upload -z name-of-the-zip.zip

or

cayohollanda@pc:~$ aws-backup --bucket bucket-name --path /folder/to/upload --zip name-of-the-zip.zip

What the script do?

  • The script compress the folder which is passed as a parameter, after this, upload the compressed archive to bucket on AWS S3

How configure the AWS Credentials?

  • To configure AWS Credentials, you need to install the AWS CLI package and configure it
cayohollanda@pc:~$ sudo apt-get install awscli
  • After that, you need to run the command to configure credentials, with this command, you will pass a Access Key ID, Secret Key ID, Region name and Output Format (default is json)
cayohollanda@pc:~$ aws configure
  • After configure AWS Credentials, your pc stay prepared to use the script.

How automate the script to backup all days

One solution to automate the backup of archives is use a Cron

  • Build a Go script to an executable
cayohollanda@pc:~$ go build main.go
  • Now, install the cron (if not have installed)
cayohollanda@pc:~$ sudo apt-get install cron
  • After that, access the file to configure a schedules
cayohollanda@pc:~$ crontab -e
  • Schedule as you prefer, save and h4v3 fun!

About

A Golang script created for backup of archives to AWS S3.


Languages

Language:Go 100.0%