func BackupData()

in s3plugin/backup.go [177:193]


func BackupData(c *cli.Context) error {
	config, sess, err := readConfigAndStartSession(c)
	if err != nil {
		return err
	}
	dataFile := c.Args().Get(1)
	fileKey := GetS3Path(config.Options.Folder, dataFile)

	bytes, elapsed, err := uploadFile(sess, config, fileKey, os.Stdin)
	if err != nil {
		return err
	}

	gplog.Debug("Uploaded %d bytes for file %s in %v", bytes,
		filepath.Base(fileKey), elapsed.Round(time.Millisecond))
	return nil
}