Skip to content

Latest commit

 

History

History
32 lines (27 loc) · 850 Bytes

copy.md

File metadata and controls

32 lines (27 loc) · 850 Bytes

Copy (WIP)

Aliases:

  • copy
  • cp

Copying Files and Scripts to Hosts and Groups

You can copy files or scripts to sets of hosts.

$ # For copying scripts/files to sets of hosts
$ gsh cp <type> <name> <-n|-g> <host|group> [dst=/target/destination] [chmod=ug+rw,o-a]

Examples:

$ # copying a file to host demo1
$ gsh copy file sshrc -n demo1 dst=/etc/sshrc chmod=a+rx
╔══════╕ File Copied!
║ File └──────────╮
╿ Name  :  Labels
└ sshrc : scope=host target=demo1 dst=/etc/sshrc chmod=a+rx
$ # copying a file to group
$ gsh copy file nginx.conf -g group1 dst=/etc/nginx/nginx.conf
╔══════╕ File Copied!
║ File └──────────╮
╿ Name  :  Labels
└ nginx.conf : scope=group target=group1 dst=/etc/nginx/nginx.conf