Evo køda:
Kod: Označi sve
#!/bin/bash
HOST='ftp.mojastranica.com'
USER='user@mojastranica.com'
PASSWD='*********'
ftp -n -v $HOST << EOT
ascii
user $USER $PASSWD
prompt
put /home/ante/Desktop/vjezba.txt
bye
EOTKod: Označi sve
Connected to mojastranica.com.
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 5 of 100 allowed.
220-Local time is now 19:13. Server port: 21.
220-This is a private system - No anonymous login
220 You will be disconnected after 60 seconds of inactivity.
Remote system type is UNIX.
Using binary mode to transfer files.
200 TYPE is now ASCII
331 User user@mojastranica.com OK. Password required
230-Your bandwidth usage is restricted
230-User user@mojsastranica.com has group access to: mojastranica
230-OK. Current restricted directory is /
230 211 Kbytes used (1%) - authorized: 20480 Kb
Remote system type is UNIX.
Using binary mode to transfer files.
Interactive mode off.
local: /home/ante/Desktop/vjezba.txt remote: /home/ante/Desktop/vjezba.txt
200 PORT command successful
553 Can't open that file: No such file or directory
221-Goodbye. You uploaded 0 and downloaded 0 kbytes.
221 Logout.