Class: Synco::Methods::SCP
- Inherits:
-
Synco::Method
- Object
- Controller
- Synco::Method
- Synco::Methods::SCP
- Defined in:
- lib/synco/methods/scp.rb
Instance Attribute Summary
Attributes inherited from Synco::Method
Attributes inherited from Controller
Instance Method Summary collapse
Methods inherited from Synco::Method
Methods inherited from Controller
#abort!, build, #fire, #freeze, #initialize, #on, #try
Constructor Details
This class inherits a constructor from Synco::Method
Instance Method Details
#call(scope) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/synco/methods/scp.rb', line 30 def call(scope) server = scope.current_server directory = scope.directory server.run( *@command, *arguments, # If the destination directory already exists, scp will create the source directory inside the destinatio directory. This behaviour means that running scp multiple times gives different results, i.e. the first time it will copy source/* to destination/*, but the second time you will end up with destination/source/*. Putting a dot after the first path alleviates this issue for some reason. scope.master_server.connection_string(directory, on: server) + '.', scope.target_server.connection_string(directory, on: server) ) end |
#default_command ⇒ Object
26 27 28 |
# File 'lib/synco/methods/scp.rb', line 26 def default_command ['scp', '-pr'] end |