1Rex::Commands::Rsync(3)User Contributed Perl DocumentatioRnex::Commands::Rsync(3)
2
3
4

NAME

6       Rex::Commands::Rsync - Simple Rsync Frontend
7

DESCRIPTION

9       With this module you can sync 2 directories via the rsync command.
10
11       Version <= 1.0: All these functions will not be reported.
12
13       All these functions are not idempotent.
14

DEPENDENCIES

16       Expect
17           The Expect Perl module is required to be installed on the machine
18           executing the rsync task.
19
20       rsync
21           The rsync command has to be installed on both machines involved in
22           the execution of the rsync task.
23

SYNOPSIS

25        use Rex::Commands::Rsync;
26
27        sync "dir1", "dir2";
28

EXPORTED FUNCTIONS

30   sync($source, $dest, $opts)
31       This function executes rsync to sync $source and $dest.
32
33       If you want to use sudo, you need to disable requiretty option for this
34       user. You can do this with the following snippet in your sudoers
35       configuration.
36
37        Defaults:username !requiretty
38
39       UPLOAD - Will upload all from the local directory html to the remote
40       directory /var/www/html.
41            task "sync", "server01", sub {
42              sync "html/*", "/var/www/html", {
43               exclude => "*.sw*",
44               parameters => '--backup --delete',
45              };
46            };
47
48            task "sync", "server01", sub {
49              sync "html/*", "/var/www/html", {
50               exclude => ["*.sw*", "*.tmp"],
51               parameters => '--backup --delete',
52              };
53            };
54
55       DOWNLOAD - Will download all from the remote directory /var/www/html to
56       the local directory html.
57            task "sync", "server01", sub {
58              sync "/var/www/html/*", "html/", {
59               download => 1,
60               parameters => '--backup',
61              };
62            };
63
64
65
66perl v5.30.0                      2019-07-24           Rex::Commands::Rsync(3)
Impressum