1SALT-CP(1) Salt SALT-CP(1)
2
3
4
6 salt-cp - salt-cp Documentation
7
8 Copy a file or files to one or more minions
9
11 salt-cp '*' [ options ] SOURCE [SOURCE2 SOURCE3 ...] DEST
12
13 salt-cp -E '.*' [ options ] SOURCE [SOURCE2 SOURCE3 ...] DEST
14
15 salt-cp -G 'os:Arch.*' [ options ] SOURCE [SOURCE2 SOURCE3 ...] DEST
16
18 salt-cp copies files from the master to all of the Salt minions matched
19 by the specified target expression.
20
21 NOTE:
22 salt-cp uses Salt's publishing mechanism. This means the privacy of
23 the contents of the file on the wire is completely dependent upon
24 the transport in use. In addition, if the master or minion is run‐
25 ning with debug logging, the contents of the file will be logged to
26 disk.
27
28 In addition, this tool is less efficient than the Salt fileserver
29 when copying larger files. It is recommended to instead use
30 cp.get_file to copy larger files to minions. However, this requires
31 the file to be located within one of the fileserver directories.
32
33 Changed in version 2016.3.7,2016.11.6,2017.7.0: Compression support
34 added, disable with -n. Also, if the destination path ends in a path
35 separator (i.e. /, or \ on Windows, the desitination will be assumed
36 to be a directory. Finally, recursion is now supported, allowing for
37 entire directories to be copied.
38
39
40 Changed in version 2016.11.7,2017.7.2: Reverted back to the old copy
41 mode to preserve backward compatibility. The new functionality added in
42 2016.6.6 and 2017.7.0 is now available using the -C or --chunked CLI
43 arguments. Note that compression, recursive copying, and support for
44 copying large files is only available in chunked mode.
45
46
48 --version
49 Print the version of Salt that is running.
50
51 --versions-report
52 Show program's dependencies and version number, and then exit
53
54 -h, --help
55 Show the help message and exit
56
57 -c CONFIG_DIR, --config-dir=CONFIG_dir
58 The location of the Salt configuration directory. This directory
59 contains the configuration files for Salt master and minions.
60 The default location on most systems is /etc/salt.
61
62 -t TIMEOUT, --timeout=TIMEOUT
63 The timeout in seconds to wait for replies from the Salt min‐
64 ions. The timeout number specifies how long the command line
65 client will wait to query the minions and check on running jobs.
66 Default: 5
67
68 Logging Options
69 Logging options which override any settings defined on the configura‐
70 tion files.
71
72 -l LOG_LEVEL, --log-level=LOG_LEVEL
73 Console logging log level. One of all, garbage, trace, debug,
74 info, warning, error, quiet. Default: warning.
75
76 --log-file=LOG_FILE
77 Log file path. Default: /var/log/salt/master.
78
79 --log-file-level=LOG_LEVEL_LOGFILE
80 Logfile logging log level. One of all, garbage, trace, debug,
81 info, warning, error, quiet. Default: warning.
82
83 Target Selection
84 The default matching that Salt utilizes is shell-style globbing around
85 the minion id. See
86 https://docs.python.org/3/library/fnmatch.html#module-fnmatch.
87
88 -E, --pcre
89 The target expression will be interpreted as a PCRE regular ex‐
90 pression rather than a shell glob.
91
92 -L, --list
93 The target expression will be interpreted as a comma-delimited
94 list; example: server1.foo.bar,server2.foo.bar,example7.quo.qux
95
96 -G, --grain
97 The target expression matches values returned by the Salt grains
98 system on the minions. The target expression is in the format of
99 '<grain value>:<glob expression>'; example: 'os:Arch*'
100
101 This was changed in version 0.9.8 to accept glob expressions in‐
102 stead of regular expression. To use regular expression matching
103 with grains, use the --grain-pcre option.
104
105 --grain-pcre
106 The target expression matches values returned by the Salt grains
107 system on the minions. The target expression is in the format of
108 '<grain value>:< regular expression>'; example: 'os:Arch.*'
109
110 -N, --nodegroup
111 Use a predefined compound target defined in the Salt master con‐
112 figuration file.
113
114 -R, --range
115 Instead of using shell globs to evaluate the target, use a range
116 expression to identify targets. Range expressions look like
117 %cluster.
118
119 Using the Range option requires that a range server is set up
120 and the location of the range server is referenced in the master
121 configuration file.
122
123 -C, --chunked
124 Use new chunked mode to copy files. This mode supports large
125 files, recursive directories copying and compression.
126
127 New in version 2016.11.7,2017.7.2.
128
129
130 -n, --no-compression
131 Disable gzip compression in chunked mode.
132
133 New in version 2016.3.7,2016.11.6,2017.7.0.
134
135
137 salt(1) salt-master(1) salt-minion(1)
138
140 Thomas S. Hatch <thatch45@gmail.com> and many others, please see the
141 Authors file
142
143
144
145
1463004.2 May 12, 2022 SALT-CP(1)