table of contents
other versions
- buster 1.6.0-1
- buster-backports 1.12.2-1~bpo10+1
- testing 1.13.2-1
- unstable 1.13.3-1
Rex::Commands::Rsync(3pm) | User Contributed Perl Documentation | Rex::Commands::Rsync(3pm) |
NAME¶
Rex::Commands::Rsync - Simple Rsync FrontendDESCRIPTION¶
With this module you can sync 2 directories via the rsync command.Version <= 1.0: All these functions will not be reported.
All these functions are not idempotent.
DEPENDENCIES¶
- Expect
- The Expect Perl module is required to be installed on the machine executing the rsync task.
- rsync
- The rsync command has to be installed on both machines involved in the execution of the rsync task.
SYNOPSIS¶
use Rex::Commands::Rsync; sync "dir1", "dir2";
EXPORTED FUNCTIONS¶
sync($source, $dest, $opts)¶
This function executes rsync to sync $source and $dest. The "rsync" command is invoked with the "--recursive --links --verbose --stats" options set.If you want to use sudo, you need to disable requiretty option for this user. You can do this with the following snippet in your sudoers configuration.
Defaults:username !requiretty
- UPLOAD - Will upload all from the local directory html to the remote directory /var/www/html.
-
task "sync", "server01", sub { sync "html/*", "/var/www/html", { exclude => "*.sw*", parameters => '--backup --delete', }; }; task "sync", "server01", sub { sync "html/*", "/var/www/html", { exclude => ["*.sw*", "*.tmp"], parameters => '--backup --delete', }; };
- DOWNLOAD - Will download all from the remote directory /var/www/html to the local directory html.
-
task "sync", "server01", sub { sync "/var/www/html/*", "html/", { download => 1, parameters => '--backup', }; };
2020-09-18 | perl v5.28.1 |