Rex::C...:Rsync(3pm)
π Rex::Commands::Rsync β the manual, but make it cute π
okay so bestie, welcome to Rex::Commands::Rsync (you'll see it filed under Rex::C...:Rsync(3pm) in the docs, the name got a lil truncated, it's giving ctrl+c energy, we move π
). It's a Simple Rsync Frontend and honestly? iconic.
β¨ NAME β¨
Rex::Commands::Rsync β Simple Rsync Frontend π¦
πΈ DESCRIPTION πΈ
With this module you can sync 2 directories via the rsync command. that's the whole vibe. two dirs, one command, slay. π
Version <= 1.0: All these functions will not be reported. so if you're on the old version, no receipts, no nothing, we don't talk about her π
Also important, no cap: All these functions are not idempotent. like, running them again is not the same as running them once. it's giving "chaotic", it's giving "she does what she wants". be aware. π
π DEPENDENCIES π
Expectβ the Expect Perl module is required to be installed on the machine executing the rsync task. no Expect, no rsync task, periodt.rsyncβ thersynccommand has to be installed on both machines involved in the execution of the rsync task. both of them. like, both. π
β SYNOPSIS β
use Rex::Commands::Rsync;
sync "dir1", "dir2";
literally that. two lines and you're synced. β¨
π 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. yeah, all four, automatically, she's thorough like that. π
If you want to use sudo, you need to disable the requiretty option for this user. You can do this with the following snippet in your sudoers configuration. (yes bestie, sudoers, the scary file, be careful in there π«Ά)
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',
};
};
not me showing you two whole ways to do the exclude π one string, or a whole array of patterns β she contains multitudes. π¦
πΈ 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',
};
};
see how the download => 1 flips the whole thing around? main character energy fr fr. π₯
heads up bestie: when the function does stuff, it doesn't report it, and it isn't idempotent β we said it once but it's that important. read it again. π
that's the whole manual, you ate it, you're welcome π«Ά
perl v5.40.1 π 2025-10-03 π and that's the tea β Rex::Commands::Rsync(3pm), out. π
π¦ where this page comes from
- ubuntu resolute: rex 1.16.1-1 Β· Apache-2.0
- ubuntu stonking: rex 1.16.1-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms