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/
下