#!/bin/sh
HOST='ftp.mistonline.in'
USER=''
PASSWD=''
FILE='file.txt'
ftp -n $HOST << END
quote USER $USER
quote PASS $PASSWDcd databackup/DB/
put $FILE
quit
END
exit 0
The Tricks
Getting the password to the ftp server without having the ftp client program read the password from /dev/tty requires two tricks:
- Using the -n option on the ftp client program to prevent the ftp client from trying to log in immediately. That way, the ftp client does not ask for a user ID and password. No use of /dev/tty.
- Use the ftp client program command quote to send user ID and password to the ftp server.
- The file /dev/tty is a character file with major number 5 and minor number 0, usually of mode 0666 and owner.group root.tty.
- /dev/tty helps output displayed to the (terminal)
Incoming search terms:
- javascript ftp example (6)
- ftp shell tutorial (5)
- ftp shell script size (4)
- shell script to ftp files from one server to another (3)
- ftp files from one server to another using shell script (3)
- how to find javascript keycode for double quote? (3)
- ftp shell php (2)
- shell script to ftp a file from one server to another (2)
- shell check file size ftp (2)
- javascript keycode of double quote (2)
- tuto ftp shell (2)
- HowTo o FTP em um shell script no servidor (2)
- shell script ftp files one server another (1)
- shell script ftp original file size (1)
- searching 1 2 3 days file ftp shell scripting (1)
- shell script ftp server (1)
- shell desktop file in ftp (1)
- shell desktop for ftp (1)
- Shell script for password expire alert (1)
- shell script for ftp server (1)
- shell FTP size (1)
- shell script for ftp file from one server to another (1)
- shell script for file desktop to linux server (1)
- shell scrip and ftp and ftp size check (1)
- shell ftp upload (1)
- shell script ftp upload check file size (1)
- validate ftp shell (1)
- unix shell script to ftp a file from your desktop (1)
- unix shell check ftp file size (1)
- unix ftp shell -i (1)
- unix ftp check file size (1)
- size ftp shell script (1)
- simple unix shell scripts mysql file (1)
- simple php shell scripts (1)
- simple ftp shell (1)
- shellscripts ftp (1)
- shell script validation for ftp (1)
- shell script to tftp files (1)
- shell script to ftp files from a server (1)
- shell script to check file size (1)
