Makis
Makis

Reputation: 1254

Execute FTP command file in Linux

As described in the title, I want to login in the ftp server and run a local FTP command file with ftp commands, in one single command that will be executed through php. I have done this in the past but with sftp but not with ftp.

I want to achieve something like the following that I have done for sftp:

sftp -b commands.txt user@host

The commands.txt file contains the ftp commands to be run in the server (e.g mget)

Upvotes: 1

Views: 1471

Answers (1)

Martin Prikryl
Martin Prikryl

Reputation: 202721

Common Linux ftp does not have any option to provide a script file.

But you can use a standard input redirection instead:

ftp < commands.txt

Upvotes: 3

Related Questions