1Rex::Commands::Upload(3U)ser Contributed Perl DocumentatiRoenx::Commands::Upload(3)
2
3
4
6 Rex::Commands::Upload - Upload a local file to a remote server
7
9 With this module you can upload a local file via sftp to a remote host.
10
12 task "upload", "remoteserver", sub {
13 upload "localfile", "/remote/file";
14 };
15
17 upload($local, $remote)
18 Perform an upload. If $remote is a directory the file will be uploaded
19 to that directory.
20
21 task "upload", "remoteserver", sub {
22 upload "localfile", "/path";
23 };
24
25 This function supports the following hooks:
26
27 before
28 This gets executed before anything is done. All original parameters
29 are passed to it.
30
31 The return value of this hook overwrites the original parameters of
32 the function-call.
33
34 before_change
35 This gets executed right before the new file is written. The local
36 file name, and the remote file name are passed as parameters.
37
38 after_change
39 This gets executed right after the file was written. On top of the
40 local file name, and the remote file name, any returned results are
41 passed as parameters.
42
43 after
44 This gets executed right before the upload() function returns. All
45 original parameters, and any results returned are passed to it.
46
47
48
49perl v5.36.1 2023-08-07 Rex::Commands::Upload(3)