Wrapper for rsync
New in version 2014.1.0.
This data can also be passed into pillar. Options passed into opts will overwrite options passed into pillar.
Changed in version 2016.3.0: Return data now contains just the contents of the rsyncd.conf as a string, instead of a dictionary as returned from cmd.run_all
.
Returns the contents of the rsync config file
CLI Example:
salt '*' rsync.config
Changed in version 2016.3.0: Return data now contains just the output of the rsync command, instead of a dictionary as returned from
cmd.run_all
.Rsync files from src to dst
- src
- The source location where files will be rsynced from.
- dst
- The destination location where files will be rsynced to.
- delete : False
- Whether to enable the rsync --delete flag, which will delete extraneous files from dest dirs
- force : False
- Whether to enable the rsync --force flag, which will force deletion of dirs even if not empty.
- update : False
- Whether to enable the rsync --update flag, which forces rsync to skip any files which exist on the destination and have a modified time that is newer than the source file.
- passwordfile
- A file that contains a password for accessing an rsync daemon. The file should contain just the password.
- exclude
- Whether to enable the rsync --exclude flag, which will exclude files matching a PATTERN.
- excludefrom
- Whether to enable the rsync --excludefrom flag, which will read exclude patterns from a file.
- dryrun : False
- Whether to enable the rsync --dry-run flag, which will perform a trial run with no changes made.
- rsh
- Whether to enable the rsync --rsh flag, to specify the remote shell to use.
- additional_opts
- Any additional rsync options, should be specified as a list.
Specify a salt fileserver environment to be used.
CLI Example:
salt '*' rsync.rsync /path/to/src /path/to/dest delete=True update=True passwordfile=/etc/pass.crt exclude=exclude/dir
salt '*' rsync.rsync /path/to/src delete=True excludefrom=/xx.ini
salt '*' rsync.rsync /path/to/src delete=True exclude='[exclude1/dir,exclude2/dir]' additional_opts='["--partial", "--bwlimit=5000"]'
Changed in version 2016.3.0: Return data now contains just the version number as a string, instead of a dictionary as returned from cmd.run_all
.
Returns rsync version
CLI Example:
salt '*' rsync.version
© 2019 SaltStack.
Licensed under the Apache License, Version 2.0.
https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.rsync.html