Cross server files/direcories transfer with net/scp in ruby on rails

Some times while dealing with load balanced server we require to manage assets across servers, need to transfer data between load balanced
servers, workout with some gems and plugins finally found solution.

Following code snipts gives you brief on process.

require 'net/scp'
Net::SCP.start(@host, @host_user, :password => @password) do |scp|
scp.upload! source, dest, :recursive => true
end

stay connected ! RoR rules ……

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s