Naja, was vorgeschlagen wurde, automatisiere den FTP-Client. So ein Client ist bei jeder Distribution dabei, Beispiel
Code:
ftp
ftp> open 192.168.10.111
Connected to 192.168.10.111.
220 RT-IP FTP Server ready. Type HELP for help
Name (192.168.10.111:root): admin
331 User name okay, need password.
Password:
230 User logged in, proceed.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> put /var/www/index.html /index2.html
local: /var/www/index.html remote: /index2.html
200 Command okay.
150 File status okay; about to open data connection.
226 Closing data connection. Transfer succeeded
177 bytes sent in 0.00 secs (987.7 kB/s)
ftp> close
221 Service closing control connection. Bye...
ftp> bye
Nun kannst du diesen Client sagen, was er machen soll, also legt man eine Kommandodatei an:
Code:
echo open 192.168.10.111 > cmds.ftp
echo user admin *** >> cmds.ftp
echo put /var/www/index.html /index.2html >> cmds.ftp
echo close >> cmds.ftp
echo bye >> cmds.ftp
Nun kannst du den Client so starten:
Code:
ftp -nv < cmds.ftp
Connected to 192.168.10.111.
220 RT-IP FTP Server ready. Type HELP for help
331 User name okay, need password.
230 User logged in, proceed.
Remote system type is UNIX.
Using binary mode to transfer files.
local: /var/www/index.html remote: /index.2html
200 Command okay.
150 File status okay; about to open data connection.
226 Closing data connection. Transfer succeeded
177 bytes sent in 0.00 secs (949.7 kB/s)
221 Service closing control connection. Bye...
Was also gemeint ist, erzeuge eine entsprechende Kommandodatei, ein entsprechendes for hast du ja bereits, alternativ, halt mit mput arbeiten. Siehe man 1 ftp.
Lesezeichen