Example #1
0
func (h *RpcClient) CheckDeployPath(r *http.Request, args *rpc.CheckDeployPathArgs, reply *rpc.RpcReply) error {
	if err := utils.PathEnable(args.Path); err != nil {
		reply.Response = err.Error()
	} else {
		reply.Response = true
	}
	return nil
}
Example #2
0
func RemoveBackup(path string) error {
	root := filepath.Join(backupPath, path)
	err := utils.PathEnable(root)
	if err != nil {
		return err
	}
	_, err = sh.Command("rm", "-rf", root).Output()
	if err != nil {
		return err
	}

	return nil
}