Rex::Co...::Rsync(3)

πŸ“¦ version 1.14.3, in nixos 26.05, nixpkgs unstable

πŸ’– 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 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 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 from Rex::Co...::Rsync(3) with perl v5.42.3, dated 2023-08-05, and that's the cute little sign-off πŸ’–πŸ«Ά
πŸ“¦ where this page comes from