salt-cp.rst 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. ===========
  2. ``salt-cp``
  3. ===========
  4. Copy a file or files to one or more minions
  5. Synopsis
  6. ========
  7. .. code-block:: bash
  8. salt-cp '*' [ options ] SOURCE [SOURCE2 SOURCE3 ...] DEST
  9. salt-cp -E '.*' [ options ] SOURCE [SOURCE2 SOURCE3 ...] DEST
  10. salt-cp -G 'os:Arch.*' [ options ] SOURCE [SOURCE2 SOURCE3 ...] DEST
  11. Description
  12. ===========
  13. salt-cp copies files from the master to all of the Salt minions matched by the
  14. specified target expression.
  15. .. note::
  16. salt-cp uses Salt's publishing mechanism. This means the privacy of the
  17. contents of the file on the wire is completely dependent upon the transport
  18. in use. In addition, if the master or minion is running with debug logging,
  19. the contents of the file will be logged to disk.
  20. In addition, this tool is less efficient than the Salt fileserver when
  21. copying larger files. It is recommended to instead use
  22. :py:func:`cp.get_file <salt.modules.cp.get_file>` to copy larger files to
  23. minions. However, this requires the file to be located within one of the
  24. fileserver directories.
  25. .. versionchanged:: 2016.3.7,2016.11.6,2017.7.0
  26. Compression support added, disable with ``-n``. Also, if the destination
  27. path ends in a path separator (i.e. ``/``, or ``\`` on Windows, the
  28. desitination will be assumed to be a directory. Finally, recursion is now
  29. supported, allowing for entire directories to be copied.
  30. .. versionchanged:: 2016.11.7,2017.7.2
  31. Reverted back to the old copy mode to preserve backward compatibility. The
  32. new functionality added in 2016.6.6 and 2017.7.0 is now available using the
  33. ``-C`` or ``--chunked`` CLI arguments. Note that compression, recursive
  34. copying, and support for copying large files is only available in chunked
  35. mode.
  36. Options
  37. =======
  38. .. program:: salt-cp
  39. .. include:: _includes/common-options.rst
  40. .. include:: _includes/timeout-option.rst
  41. .. |timeout| replace:: 5
  42. .. include:: _includes/logging-options.rst
  43. .. |logfile| replace:: /var/log/salt/master
  44. .. |loglevel| replace:: ``warning``
  45. .. include:: _includes/target-selection.rst
  46. .. option:: -C, --chunked
  47. Use new chunked mode to copy files. This mode supports large files, recursive
  48. directories copying and compression.
  49. .. versionadded:: 2016.11.7,2017.7.2
  50. .. option:: -n, --no-compression
  51. Disable gzip compression in chunked mode.
  52. .. versionadded:: 2016.3.7,2016.11.6,2017.7.0
  53. See also
  54. ========
  55. :manpage:`salt(1)`
  56. :manpage:`salt-master(1)`
  57. :manpage:`salt-minion(1)`