Documentation ¶
Index ¶
- Constants
- Variables
- func AddFileToS3(s *session.Session, fileDir string) error
- func Compress(files []*os.File, dest string) error
- func CopyDataFile(prefix string) error
- func DeCompress(tarFile, dest string) error
- func SendToS3() error
- func StartFakePort()
- func StopFakePort()
- func UpdateRouter(s *session.Session, content string) error
- type Agent
Constants ¶
View Source
const ( S3_REGION = "us-east-1" // lightsail.RegionNameEuCentral1 S3_BUCKET = "crystalline-cosd-databackup" FAKE_PORT = "9090" FULL_NODE_SUFFIX = "-fulldata.tar.gz" NON_FULL_NODE_SUFFIX = "-data.tar.gz" TMP_DIR_NAME = "/tmp" BLOG_NAME = "/blog" CHECHPOINT_NAME = "/checkpoint" DB_NAME = "/db" ROUTER = "route.txt" )
Variables ¶
View Source
var AgentCmd = func() *cobra.Command { cmd := &cobra.Command{ Use: "agent", Short: "start backup agent", Long: "start back agent and regularly sends cosd data files to backup server", Run: startBackUpAgent, } cmd.Flags().StringVarP(&dataDir, "data_dir", "d", "", "directory of cosd data") cmd.Flags().Int32VarP(&interval, "interval", "i", 3*86400, "backup data every interval seconds") cmd.Flags().BoolVarP(&fullNodeBackup, "fullNodeBackup", "f", false, "backup a full node or not") return cmd }
View Source
var ClientCmd = func() *cobra.Command { cmd := &cobra.Command{ Use: "client", Short: "start backup client", Run: startBackUpClient, } cmd.Flags().Int16VarP(&serverPort, "server_port", "p", 9722, "") cmd.Flags().StringVarP(&serverIP, "server_ip", "i", "", "") return cmd }
View Source
var ServerCmd = func() *cobra.Command { cmd := &cobra.Command{ Use: "server", Short: "start backup server", Run: startBackUpServer, } cmd.Flags().Int16VarP(&port, "port", "p", 9722, "") cmd.Flags().StringVarP(&ip, "ip", "i", "", "") cmd.Flags().StringVarP(&backupDir, "dir", "d", "~/contentos_data_backup", "") return cmd }
Functions ¶
func AddFileToS3 ¶
AddFileToS3 will upload a single file to S3, it will require a pre-built aws session and will set file info like content type and encryption on the uploaded file.
func CopyDataFile ¶ added in v1.0.6
func DeCompress ¶
func StartFakePort ¶ added in v1.0.6
func StartFakePort()
func StopFakePort ¶ added in v1.0.6
func StopFakePort()
Types ¶
Click to show internal directories.
Click to hide internal directories.