Rex Commands Upload :

RexCommandsUpload :

导出函数

upload($local, $remote)
如果$remote是目录,将会上传至此目录中。


 task "upload", "remoteserver", sub {
   upload "localfile", "/path";
 };

 task "upload", "192.168.137.3", sub {
   upload "/root/ssh.sh", "/tmp/file";
 };
[root@node01 Rex]# rex upload
[2017-05-10 07:05:38] INFO - Running task upload on 192.168.137.3
[2017-05-10 07:05:49] INFO - All tasks successful on all hosts

将本地的/root/ssh.sh 上传到/tmp/
下

原文地址:https://www.cnblogs.com/hzcya1995/p/13349720.html