Rex::Commands::Rsync(3pm) | User Contributed Perl Documentation | Rex::Commands::Rsync(3pm) |
Rex::Commands::Rsync - Simple Rsync Frontend
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.
use Rex::Commands::Rsync; sync "dir1", "dir2";
This function executes the rsync command on the local machine (where rex is being run) to sync $source and $dest with a remote. 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
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', }; };
task "sync", "server01", sub { sync "/var/www/html/*", "html/", { download => 1, parameters => '--backup', }; };
2023-03-06 | perl v5.36.0 |