()
| 389 | } |
| 390 | |
| 391 | func initExportBackup() { |
| 392 | ExportBackup.Cmd = &cobra.Command{ |
| 393 | Use: "export_backup", |
| 394 | Short: "Export data inside single full or incremental backup", |
| 395 | Long: ``, |
| 396 | Args: cobra.NoArgs, |
| 397 | Run: func(cmd *cobra.Command, args []string) { |
| 398 | defer x.StartProfile(ExportBackup.Conf).Stop() |
| 399 | if err := runExportBackup(); err != nil { |
| 400 | fmt.Fprintln(os.Stderr, err) |
| 401 | os.Exit(1) |
| 402 | } |
| 403 | }, |
| 404 | Annotations: map[string]string{"group": "tool"}, |
| 405 | } |
| 406 | |
| 407 | ExportBackup.Cmd.SetHelpTemplate(x.NonRootTemplate) |
| 408 | flag := ExportBackup.Cmd.Flags() |
| 409 | flag.StringVarP(&opt.location, "location", "l", "", |
| 410 | `Sets the location of the backup. Both file URIs and s3 are supported. |
| 411 | This command will take care of all the full + incremental backups present in the location.`) |
| 412 | flag.StringVarP(&opt.destination, "destination", "d", "", |
| 413 | "The folder to which export the backups.") |
| 414 | flag.StringVarP(&opt.format, "format", "f", "rdf", |
| 415 | "The format of the export output. Accepts a value of either rdf or json") |
| 416 | flag.BoolVar(&opt.upgrade, "upgrade", false, |
| 417 | `If true, retrieve the CORS from DB and append at the end of GraphQL schema. |
| 418 | It also deletes the deprecated types and predicates. |
| 419 | Use this option when exporting a backup of 20.11 for loading onto 21.03.`) |
| 420 | x.RegisterEncFlag(flag) |
| 421 | } |
| 422 | |
| 423 | type bufWriter struct { |
| 424 | writers *worker.Writers |
no test coverage detected