In UNIX/Linux, you can add a “.netrc” file in your HOME directory and completely automate ftp sessions. The “.netrc” may look like :
#more .netrc
machine <ServerName> login <UserName> password <Password>
For Example:
machine rdev200 login ravi password rabindra
The automated script may look like :
#!/usr/bin/sh
ftp -i -v [hostname/ip-address] <<ENDOFSCRIPT
cd [to_dir]
lcd [from_dir]
put <FileName>
bye
ENDOFSCRIPT
#more .netrc
machine <ServerName> login <UserName> password <Password>
For Example:
machine rdev200 login ravi password rabindra
The automated script may look like :
#!/usr/bin/sh
ftp -i -v [hostname/ip-address] <<ENDOFSCRIPT
cd [to_dir]
lcd [from_dir]
put <FileName>
bye
ENDOFSCRIPT
No comments :
Post a Comment