You can use the upload() helper:

   upload("../my_dir", "#{shared_path}/my_dir", :via  
=> :scp, :recursive => true)

That ought to work. Note, though, that it will be _much_ faster to  
upload a directory tree by tarring it and transferring the tarball.

- Jamis

On Oct 21, 2008, at 10:26 PM, DyingToLearn wrote:

>
> Hi,
>
> I am trying to create a cap recipe that copies a directory from my
> local machine to a server.
>
> At the moment I have to resort to this:
> system "scp -r #{File.expand_path(File.dirname(__FILE__))}/../my_dir
> [EMAIL PROTECTED]:#{shared_path}/my_dir"
>
> That doesn't seem like the capistrano way to do things (since it only
> works with the one server specified). I couldn't get put do copy a
> directory though. I tried muddling my way through the source code, but
> I couldn't figure it out.
>
> Any ideas?
>
> Thanks
>
> >


--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---

Reply via email to