Rex::Co...ds::Sync(3)

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

πŸ’– NAME πŸ’–

okay bestie, this is the User Contributed Perl Documentation page for Rex::Co...ds::Sync(3), and the module it’s about is Rex::Commands::Sync 🫢. Its whole personality? sync directories. That’s the vibe. πŸ’…

✨ DESCRIPTION ✨

Rex::Commands::Sync is the module that can sync directories between your Rex system and your servers β€” and the iconic part is that it does this without the need of rsync. No rsync required, no cap. πŸ¦‹βœ¨

🌸 SYNOPSIS 🌸

okay so here’s the literal synopsis, bestie β€” keep the code exactly as it is:

        use Rex::Commands::Sync;

        task "prepare", "mysystem01", sub {
          # upload directory recursively to remote system.
          sync_up "/local/directory", "/remote/directory";

          sync_up "/local/directory", "/remote/directory", {
            # setting custom file permissions for every file
            files => {
              owner => "foo",
              group => "bar",
              mode  => 600,
            },
            # setting custom directory permissions for every directory
            directories => {
              owner => "foo",
              group => "bar",
              mode  => 700,
            },
            exclude => [ '*.tmp' ],
            parse_templates => TRUE|FALSE,
            on_change => sub {
             my (@files_changed) = @_;
            },
          };

          # download a directory recursively from the remote system to the local machine
          sync_down "/remote/directory", "/local/directory";
        };

So yeah: sync_up uploads a directory recursively to the remote system β€” from "/local/directory" to "/remote/directory" β€” and sync_down downloads a directory recursively from the remote system to the local machine, like "/remote/directory" to "/local/directory". The little settings hash for sync_up shows files with owner => "foo", group => "bar", mode => 600; directories with owner => "foo", group => "bar", mode => 700; exclude => [ '*.tmp' ]; parse_templates => TRUE|FALSE; and on_change => sub { my (@files_changed) = @_; }. Obsessed. πŸ’–


πŸŽ€ sign-off: this User Contributed Perl Documentation page was made with perl v5.42.3, dated 2023-08-05, and it’s literally Rex::Co...ds::Sync(3) β€” byeee bestie, go sync something cute πŸ§šπŸ’œ

πŸ“¦ where this page comes from