Using the Switchtower "put" helper
Posted by admin, Mon Jan 16 08:51:20 UTC 2006
It would be really nice if the “put” helper worked as advertised. Unfortunately, when I used it today, I ran into an annoying problem. The destination file already existed, and it’s size was larger than the source file. So what I got was a munged file that started with the source file contents, and ended with leftover crap from the original destination file. This was definitely not what I intended.
It is an easy enough problem to work around. One uses the “delete” helper on the original destination file, first.
SwitchTower: Automating Application Deployment |
The put helper let’s you transfer data from the local host to a file on the remote host. In this case, though, the file is transferred to all associated servers via a single call to put. If Net::SFTP is available, it will be used to transfer the files, otherwise a less-robust method is used (pipe to cat).