I created this simple script to FTP data to another server:
Usage:Code:#!/bin/sh -vx # Script to FTP data to server # Paramters: host FTP Server # user FTP Username # passwd FTP Password # file File to send/put ############################################################################ # Variables HOST=$1 USER=$2 PASSWD=$3 FILE=$4 TONAME=$5 # Connect to FTP HOST and Send File ftp -n $HOST <<END_SCRIPT quote USER $USER quote PASS $PASSWD dir ascii put $FILE $TONAME dir quit END_SCRIPT exit 0
Example:Code:# ./ftpscript <host> <username> <passwd> <filename> <toname>
Code:# ./ftpscript 127.0.0.1 jordan SomePass /var/log/messages /upload/messages.txt
Interesting. Is there no wput (opposite of wget) command?
Yes, there is but it doesn't come "stock" on any Linux distro that I know of. Home of wput
What do you mean with "stock", you mean out-of-the-box?
Yes I believe that is what he meant. "stock" is a term often used in English/America that means exactly like you stated: out-of-the-box with no enhancements.
how a syntax to make password n username with list...like this
./ftpscript <host> <username.txt> <passwd.txt> <filename> <toname>
You'll need to change the script to read the files. You can use the 'cat' command for this.
ohhh, use the cat for call a file text in to bash...
right or not...
if you want to use sftp you can use ssh keys which removes the need for username / password.
You can use cat to read the contents of a file and add those contents to a variable.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks