SALT-CP(1)

πŸ’– SALT-CP(1) πŸ’–

okay bestie, welcome to salt-cp β€” like, the whole manual, but make it make sense. this is salt-cp from the Salt fam, and yes she is that girl. πŸ’…


✨ NAME ✨

salt-cp β€” salt-cp documentation, and also the vibe where you copy a file or files to one or more minions. no cap, that's literally the whole job. πŸ¦‹


🌸 SYNOPSIS 🌸

salt-cp '*' [ options ] SOURCE [SOURCE2 SOURCE3 ...] DEST

salt-cp -E '.*' [ options ] SOURCE [SOURCE2 SOURCE3 ...] DEST

salt-cp -G 'os:Arch.*' [ options ] SOURCE [SOURCE2 SOURCE3 ...] DEST

three lil fits, pick your fave. πŸŽ€


πŸ’œ DESCRIPTION πŸ’œ

so here's the tea: salt-cp copies files from the master to all of the Salt minions matched by whatever target expression you gave it. that's it, that's the plot. ✨

NOTE: ⚠️ bestie, listen. salt-cp uses Salt's publishing mechanism. that means the privacy of the contents of the file on the wire is completely dependent upon the transport in use. and also β€” if the master or minion is running with debug logging, the contents of the file will be logged to disk. like, the whole file. in a log. be aware. 😭

also, real talk: this tool is less efficient than the Salt fileserver when copying larger files. the glow-up recommendation is to use cp.get_file instead to copy larger files to minions. the catch? that requires the file to be located within one of the fileserver directories. so, trade-offs, iykyk. πŸ™ˆ

Changed in version 2016.3.7,2016.11.6,2017.7.0: compression support got added, disable it with -n. also, if the destination path ends in a path separator (i.e. /, or \ on Windows), the destination will be assumed to be a directory. and finally, recursion is now supported, allowing for entire directories to be copied. we love a glow-up. 🧚

Changed in version 2016.11.7,2017.7.2: reverted back to the old copy mode to preserve backward compatibility. the new functionality added in 2016.6.6 and 2017.7.0 is now available using the -C or --chunked CLI arguments. note that compression, recursive copying, and support for copying large files is only available in chunked mode. so if you want the fancy stuff, you gotta opt in. periodt. πŸ‘‘


πŸ’… OPTIONS πŸ’…

the menu. order up. πŸ“

  • --version β€” print the version of Salt that is running. slay, now you know.
  • --versions-report β€” show program's dependencies and version number, and then exit. a whole lil report card. πŸ“‹
  • -h, --help β€” show the help message and exit. when in doubt, ask for help, that's self-care.
  • -c CONFIG_DIR, --config-dir=CONFIG_dir β€” the location of the Salt configuration directory. this directory contains the configuration files for Salt master and minions. the default location on most systems is /etc/salt.
  • -t TIMEOUT, --timeout=TIMEOUT β€” the timeout in seconds to wait for replies from the Salt minions. the timeout number specifies how long the command line client will wait to query the minions and check on running jobs. Default: 5

🌈 Logging Options 🌈

logging options which override any settings defined on the configuration files. your config said one thing, your CLI said another, CLI wins. πŸ’

  • -l LOG_LEVEL, --log-level=LOG_LEVEL β€” console logging log level. one of all, garbage, trace, debug, info, warning, error, quiet. Default: warning.
  • --log-file=LOG_FILE β€” log file path. Default: /var/log/salt/master.
  • --log-file-level=LOG_LEVEL_LOGFILE β€” logfile logging log level. one of all, garbage, trace, debug, info, warning, error, quiet. Default: warning.

🎯 Target Selection 🎯

the default matching that Salt utilizes is shell-style globbing around the minion id. see https://docs.python.org/3/library/fnmatch.html#module-fnmatch. cute, right? πŸ’™

  • -E, --pcre β€” the target expression will be interpreted as a PCRE regular expression rather than a shell glob. regex girlies rise. πŸ”₯
  • -L, --list β€” the target expression will be interpreted as a comma-delimited list; example: server1.foo.bar,server2.foo.bar,example7.quo.qux
  • -G, --grain β€” the target expression matches values returned by the Salt grains system on the minions. the target expression is in the format of '<grain value>:<glob expression>'; example: 'os:Arch*'

this was changed in version 0.9.8 to accept glob expressions instead of regular expression. to use regular expression matching with grains, use the --grain-pcre option.

  • --grain-pcre β€” the target expression matches values returned by the Salt grains system on the minions. the target expression is in the format of '<grain value>:< regular expression>'; example: 'os:Arch.*'
  • -N, --nodegroup β€” use a predefined compound target defined in the Salt master configuration file.
  • -R, --range β€” instead of using shell globs to evaluate the target, use a range expression to identify targets. range expressions look like %cluster.

using the Range option requires that a range server is set up and the location of the range server is referenced in the master configuration file. no range server, no range. πŸ™…

  • -C, --chunked β€” use new chunked mode to copy files. this mode supports large files, recursive directories copying and compression.

New in version 2016.11.7,2017.7.2.

  • -n, --no-compression β€” disable gzip compression in chunked mode.

New in version 2016.3.7,2016.11.6,2017.7.0.


πŸ‘€ SEE ALSO πŸ‘€

salt(1) salt-master(1) salt-minion(1)

the friend group. go say hi. 🫢


✍️ AUTHOR ✍️

Thomas S. Hatch <thatch45@gmail.com> and many others, please see the Authors file. shoutout to the whole squad, fr fr. πŸ’–


2025


and that's the whole page, bestie β€” you ate that πŸ’…βœ¨

version 3007.8, generated on September 18, 2025 at 06:58:52 UTC. that's the tea, drink up. πŸŽ€πŸ¦‹β­

πŸ“¦ where this page comes from