Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Currently i need to create a shell script on my gameserver that will have to upload the day's CSS log files to another server...however i have no idea how to do this using ftp, since ftp only takes as arguments the hostname and port of the server in the following fashion..
ftp host port
and then drops into interactive mode. how can i make it upload a file named server.log to another ftp server ?
Even without knowing the lftp command at all, I can tell you that double quotes won't help. The problem is that the shell will expand *.log into the list of files (in your current directory) which happen to have the .log filename extension, before passing everything to lftp. So, lftp will get to see something like:
... -c a.log b.log c.log etc
instead of '*.log'.
To prevent the shell from interpreting "*.log", you need to put it in SINGLE quotes, not double quotes.
It is probably better to enclose the entire FTP command in single quotes.
It may work, but it actually does (in FTP):
mput file1.log file2.log file3.log ...
This is a subtle difference, since both FTP commands should -in theory- work equally well. You may get into trouble if you have really many .log files with your approach. The single quote approach should always work.