2025-01-03 23:30:07 -06:00
|
|
|
---
|
|
|
|
title: Exec
|
|
|
|
---
|
|
|
|
|
2025-01-04 00:35:32 -06:00
|
|
|
The `exec` subcommand can do some things that the configuration file can't do yet. The command `exec host` can execute commands on many hosts.
|
2025-01-03 23:30:07 -06:00
|
|
|
|
|
|
|
`exec host` takes the following arguments:
|
|
|
|
|
|
|
|
```sh
|
2025-02-23 15:33:17 -06:00
|
|
|
-c, --commands strings Accepts space-separated names of commands.
|
2025-01-03 23:30:07 -06:00
|
|
|
-h, --help help for host
|
2025-02-23 15:33:17 -06:00
|
|
|
-m, --hosts strings Accepts space-separated names of hosts.
|
2025-01-03 23:30:07 -06:00
|
|
|
```
|
|
|
|
|
|
|
|
The commands have to be defined in the config file. The hosts need to at least be in the ssh_config(5) file.
|
|
|
|
|
|
|
|
```sh
|
2025-02-23 15:33:17 -06:00
|
|
|
backy exec host [--commands command1 -commands command2 ... | -c command1 -c command2 ...] [--hosts host1 --hosts hosts2 ... | -m host1 -c host2 ...] [flags]
|
2025-01-03 23:30:07 -06:00
|
|
|
```
|