If you need to work with files on remote server, I can recomend further solution. Create a class for server that will contain basic tasks for server configurations, like stopping, starting, working with configuration files, etc. To work with files and directories use sftp session. To work with shell commands use ssh connection. When you initialize server class object - define username and password for it. As input parameter for initialization use server ip address. Create connect and disconnect methods that will create and dispose both sftp and ssh sessions for current class. Create specific functions for actions with files, command shell and so on. Here is a short example of what I've used. I expect critics from you and improved sollutions of the same features. %w{rubygems net/sftp}.each { |x| require x}
0 Comments
Leave a Reply. |
NoticeI have removed Russian content from my website and now will post articles in English only. This is not because of some politics, Russian speaking people you are great, but just it is very hard to support bilingual web site in Weebly. For those who read my articles as usual I ask to click on a single advertisement banner on my web site. This gives me some credits and is free of charge for you. Archives
August 2016
Categories
All
|