Rex::Co...::Rsync(3)
π NAME π
Rex::Commands::Rsync β Simple Rsync Frontend. Yup, that's the name, and this Rex::Co...::Rsync(3) page comes from User Contributed Perl Documentation. It's giving straightforward, and we're obsessed π
.
β¨ DESCRIPTION β¨
Okay so with this module you can sync 2 directories via the rsync command. Literally that's the mission, bestie π¦.
Version <= 1.0: All these functions will not be reported.
And important vibe check: All these functions are not idempotent π. Like, no cap, keep that in mind.
πΈ DEPENDENCIES πΈ
- Expect β the Expect Perl module is required to be installed on the machine executing the rsync task.
- rsync β the
rsynccommand 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 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. Slay β¨.
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',
};
};
Okay bestie, that's the whole page π it comes fromRex::Co...::Rsync(3)withperl v5.42.3, dated2023-08-05, and that's the cute little sign-off ππ«Ά
π¦ where this page comes from
- nixos 26.05: perl5.42.3-Rex 1.14.3
- nixpkgs unstable: perl5.42.3-Rex 1.14.3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms