Forum: Ruby FTP

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
FTP
1d2f6e11e5f4155dc5287d986e6ee0ac?d=identicon&s=25 Philip Pratt (pratstercs)
on 2008-12-20 01:59
Hi,
I'm a complete novice to Ruby, but I would like to write an FTP server
to collect the files from my computer (internet connected) and copy them
to my server nightly. My server is a Ubuntu Linux setup with FTP and
blah. Please help me with this?
15f985dc1d6a150767736a0c65e9ef35?d=identicon&s=25 Jeremy Henty (Guest)
on 2008-12-20 03:35
(Received via mailing list)
On 2008-12-20, Philip Pratt <pratstercs@hotmail.com> wrote:

> I'm a  complete novice  to Ruby, but  I would  like to write  an FTP
> server to  collect the files  from my computer  (internet connected)
> and copy  them to  my server  nightly. My server  is a  Ubuntu Linux
> setup with FTP and blah. Please help me with this?

Do  you need  to  do any  programming  at all?   The  NcFTP client  at
http://www.ncftp.com/ncftp/ can  recursively download directories from
an FTP server to the local machine.  I have used it to do that myself.
Is that not enough?  Not that  I want to put you off Ruby programming,
but it doesn't seem necessary in this case.

Regards,

Jeremy Henty
1d2f6e11e5f4155dc5287d986e6ee0ac?d=identicon&s=25 Philip Pratt (pratstercs)
on 2008-12-20 15:04
Jeremy Henty wrote:
> On 2008-12-20, Philip Pratt <pratstercs@hotmail.com> wrote:
>
>> I'm a  complete novice  to Ruby, but  I would  like to write  an FTP
>> server to  collect the files  from my computer  (internet connected)
>> and copy  them to  my server  nightly. My server  is a  Ubuntu Linux
>> setup with FTP and blah. Please help me with this?
>
> Do  you need  to  do any  programming  at all?   The  NcFTP client  at
> http://www.ncftp.com/ncftp/ can  recursively download directories from
> an FTP server to the local machine.  I have used it to do that myself.
> Is that not enough?  Not that  I want to put you off Ruby programming,
> but it doesn't seem necessary in this case.
>
> Regards,
>
> Jeremy Henty

I would like to do this as a technical excercise first of all, plus I
want it to do specific things at certain times like upload all files in
a folder at 9PM every night, etc plus I want it to run from my Ubuntu
server.
15f985dc1d6a150767736a0c65e9ef35?d=identicon&s=25 Jeremy Henty (Guest)
on 2008-12-22 02:30
(Received via mailing list)
On 2008-12-20, Philip Pratt <pratstercs@hotmail.com> wrote:

> I would like to do this as a technical excercise first of all, plus
> I want it to do specific things at certain times like upload all
> files in a folder at 9PM every night, etc plus I want it to run from
> my Ubuntu server.

If you want it to run from your server then I think you'll have to
have some kind of mini-server on your local machine for your Ubuntu
box to contact.  That could be something standard such as ssh, which
would let your server log in and scp files.  Or perhaps FTP, and you
could script it with Net::FTP.  If you really want to do it all
yourself you could write a server and client with DRb.  That would be
interesting!  Of course you'd have to figure out the security
implications of all this.

Regards,

Jeremy Henty
4828d528e2e46f7c8160c336eb332836?d=identicon&s=25 Robert Heiler (shevegen)
on 2008-12-22 11:22
> plus I want it to do specific things at certain times like upload all
> files in a folder at 9PM every night

This is not so complicated.

First you should write a simple FTP "client" that connects to your
host. This is quite trivial, i.e.

  x = Net::FTP.new('ftp.members.a1.net')
  x.login('your_name','your_password')

Just look at the FTP class in ruby.

Once you can upload files, you can let this script run
at fixed times. One way would be with cron, or with
ruby daemons http://rubyforge.org/projects/daemons/
This topic is locked and can not be replied to.