rdsnap

package module
v0.0.0-...-4189dd7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2022 License: MIT Imports: 11 Imported by: 0

README

rdsnap

rdsnap creates a Amazon RDS snapshot.

Install

$ git clone https://github.com/rtiwsk/rdsnap
$ cd rdsnap
$ go build ./cmd/rdsnap/

Usage

$ ./rdsnap -h
Usage:
  rdsnap [options...]

Options:
  -instance    Amazon RDS DB Instance ID. (Not support Aurora)
               Required option.
  -engine      DB Engine. Select from 'mysql' and 'postgres'.
               Required option.
  -log         Logfile path. Default is Stdout.
  -user        DB Username. Specify when truncating tables.
  -password    DB Password. Specify when truncating tables.
  -tables      DB tables. Specify when truncating tables.
               table as <database>.<tablename>.
               e.g. company.sales,company.account
Example
$ ./rdsnap \
  -instance exampledb \
  -engine postgres
rdsnap: Start creating a DB snapshot.
rdsnap: Created DB snapshot: exampledb-20220406-211651
$ ./rdsnap \
  -instance exampledb \
  -engine postgres \
  -user dbadmin \
  -password 'password' \
  -tables example.usertbl,example.grouptbl
rdsnap: Start creating a DB snapshot.
rdsnap: Created DB snapshot: exampledb-20220406-213921
rdsnap: Restored DB instance: exampledb-snapshot
rdsnap: Truncated the table: example.usertbl
rdsnap: Truncated the table: example.grouptbl
rdsnap: Created DB snapshot: exampledb-snapshot-20220406-214927
rdsnap: Delete DB instance: exampledb-snapshot
rdsnap: Delete DB snapshot: exampledb-20220406-213921

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Info  *log.Logger
	Error *log.Logger
)
View Source
var Now = time.Now

Functions

func Run

func Run(cfg config, svc rdsiface.RDSAPI) (err error)

func SetConfig

func SetConfig(instance, engine, user, password, tables string, wlog io.Writer, logFlag int) config

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL