Forum Moderators: phranque

Message Too Old, No Replies

Automatic FTP through SSH?

Setting up file transfer to occur automatically

         

RandallK

6:22 pm on Apr 9, 2010 (gmt 0)

10+ Year Member



I have a site that I can access with SSH, and I am trying to figure out how to set it up to automatically FTP a file.

I have ftp'ed before from SSH before, and I've made simple batch files before to run with CRON jobs, but nothing like this.

I've searched around a bit, and can't seem to find something that walks me through exactly what needs to happen. It seems the 'unattended' part is the problem when it comes to entering passwords.

Thank you very much for any assistance.

brotherhood of LAN

6:28 pm on Apr 9, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You can use PHP's FTP functions for regular FTP access, and I believe you can use SSH also.

If you don't use PHP, a simple program called cURL can also do the job in regards to FTP connections.

RandallK

6:54 pm on Apr 9, 2010 (gmt 0)

10+ Year Member



So you are saying to do the FTP in PHP and then set a CRON to run the PHP file?

brotherhood of LAN

6:57 pm on Apr 9, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Yes, that'd be an option.

If you have a unchanging list of files, cURL may be easier for you (via cron)

RandallK

8:07 pm on Apr 9, 2010 (gmt 0)

10+ Year Member



Man I hate it when there is a super simple answer out there, and I just never saw it before. I had NO CLUE that using FTP with PHP is so simple. This will change my life.

Thanks 1,000,000^2.

maximillianos

11:37 am on Apr 10, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I had a sftp setup between two servers once. It involved saving an encrypted key on each machine and some other voodoo magic I don't remember. It worked. But unfortunately I don't remember the details.