<p dir="ltr">Scp? I rarely use ftp.</p>
<div class="gmail_quote">On Jan 22, 2013 4:55 PM, "Jim Kinney" <<a href="mailto:jim.kinney@gmail.com">jim.kinney@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
You did change the ftp command to ftp -i ? That should drop the confirm for mput.<br><br><div class="gmail_quote">On Tue, Jan 22, 2013 at 4:42 PM, Chuck Payne <span dir="ltr"><<a href="mailto:terrorpup@gmail.com" target="_blank">terrorpup@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It working, but it only putting one file, the reason it is doing this...<br>
<br>
mput dag2.txt? mput dag3.txt? 221 Goodbye.<br>
<br>
Is it asking me to enter "yes" for the other files?<br>
<span><font color="#888888"><br>
Chuck<br>
</font></span><div><div><br>
<br>
On Tue, Jan 22, 2013 at 12:35 PM, Jim Kinney <<a href="mailto:jim.kinney@gmail.com" target="_blank">jim.kinney@gmail.com</a>> wrote:<br>
> The heredoc format of the ftp line looks wrong. also, you are iterating over<br>
> a list of files and creating a new ftp connection for each file. Instead<br>
> use:<br>
><br>
> mytemp=$(mktemp -d)<br>
> mylog=$(mktemp)<br>
> cp $(cat /chroot/home/fl/fl_sdirc/files.txt) ${mytemp}<br>
> cd ${mytemp}<br>
> ftp -i <host> 2>$1>${mylog} << EOF<br>
> user <name> <passwd><br>
> binary<br>
> cd <remote path to file location><br>
> mput *<br>
> exit<br>
> EOF<br>
><br>
> On Tue, Jan 22, 2013 at 12:18 PM, Chuck Payne <<a href="mailto:terrorpup@gmail.com" target="_blank">terrorpup@gmail.com</a>> wrote:<br>
>><br>
>> Guys,<br>
>><br>
>> Ok, I think I have a better script, but I am having a problem with the<br>
>> for/loop with ftp'ing files, looks like it breaking at the <<+<br>
>><br>
>> Here is my new script<br>
>><br>
>> ========================Begin Script=================================<br>
>><br>
>> #!/bin/bash<br>
>> # ftp script<br>
>> # by Chuck Payne<br>
>> # ftp, logs, and moves files<br>
>><br>
>> LOG=$(/var/log/fl_sdirc)<br>
>> FILES=$(cat /chroot/home/fl/fl_sdirc/files.txt | wc -l)<br>
>> TIME=$(`date '+%m-%d-%Y %H:%M'`)<br>
>> FILE=$(/chroot/home/fl/fl_sdirc/files.txt)<br>
>><br>
>><br>
>> if [ -e $FILE ] ; then<br>
>> rm -f $FILE<br>
>> fi<br>
>><br>
>> ls /chroot/home/fl/fl_sdirc >> /chroot/home/fl/fl_sdirc/files.txt<br>
>><br>
>> if [ $FILE=="0"] ; then<br>
>> echo "$TIME" >> $LOG<br>
>> echo "No Files tranfer" >> $LOG<br>
>> else<br>
>><br>
>> for i in `cat /chroot/home/fl/fl_sdirc/files.txt` ; do<br>
>> ftp -n 192.168.105.29 <<+<br>
>> user flsdir essex<br>
>> binary<br>
>> put $i<br>
>> quit ;<br>
>> done<br>
>><br>
>> echo "$TIME" >> $LOG<br>
>> echo "File following file were transfer to Pawnee" >> $LOG<br>
>><br>
>> for i in `cat /chroot/home/fl/fl_sdirc/files.txt` ; do<br>
>> echo "$i" >> $LOG<br>
>> done<br>
>><br>
>> for i in `cat /chroot/home/fl/fl_sdirc/files.txt` ;<br>
>> mv $i /home/fl_sdirc/$i.$TIME ;<br>
>> done<br>
>><br>
>> fi<br>
>><br>
>><br>
>><br>
>> ========================End Script==================================<br>
>><br>
>><br>
>> --<br>
>> Terror PUP a.k.a<br>
>> Chuck "PUP" Payne<br>
>><br>
>> <a href="tel:%28678%29%20636-9678" value="+16786369678" target="_blank">(678) 636-9678</a><br>
>> -----------------------------------------<br>
>> Discover it! Enjoy it! Share it! openSUSE Linux.<br>
>> -----------------------------------------<br>
>> openSUSE -- <a href="http://en.opensuse.org/User:Terrorpup" target="_blank">en.opensuse.org/User:Terrorpup</a><br>
>> openSUSE Ambassador/openSUSE Member<br>
>> Community Manager -- Southeast Linux Foundation (SELF)<br>
>> skype,twiiter,identica,friendfeed -- terrorpup<br>
>> freenode(irc) --terrorpup/lupinstein<br>
>> Register Linux Userid: 155363<br>
>><br>
>> Have you tried SUSE Studio? Need to create a Live CD, an app you want<br>
>> to package and distribute , or create your own linux distro. Give SUSE<br>
>> Studio a try. <a href="http://www.susestudio.com" target="_blank">www.susestudio.com</a>.<br>
>> See you at Southeast Linux Fest, June 7-9, 2013 in Charlotte, NC.<br>
>> <a href="http://www.southeastlinuxfest.org" target="_blank">www.southeastlinuxfest.org</a><br>
>> _______________________________________________<br>
>> Ale mailing list<br>
>> <a href="mailto:Ale@ale.org" target="_blank">Ale@ale.org</a><br>
>> <a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
>> See JOBS, ANNOUNCE and SCHOOLS lists at<br>
>> <a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
><br>
><br>
><br>
><br>
> --<br>
> --<br>
> James P. Kinney III<br>
><br>
> Every time you stop a school, you will have to build a jail. What you gain<br>
> at one end you lose at the other. It's like feeding a dog on his own tail.<br>
> It won't fatten the dog.<br>
> - Speech 11/23/1900 Mark Twain<br>
><br>
> <a href="http://electjimkinney.org" target="_blank">http://electjimkinney.org</a><br>
> <a href="http://heretothereideas.blogspot.com/" target="_blank">http://heretothereideas.blogspot.com/</a><br>
><br>
> _______________________________________________<br>
> Ale mailing list<br>
> <a href="mailto:Ale@ale.org" target="_blank">Ale@ale.org</a><br>
> <a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
> See JOBS, ANNOUNCE and SCHOOLS lists at<br>
> <a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
><br>
<br>
<br>
<br>
--<br>
Terror PUP a.k.a<br>
Chuck "PUP" Payne<br>
<br>
<a href="tel:%28678%29%20636-9678" value="+16786369678" target="_blank">(678) 636-9678</a><br>
-----------------------------------------<br>
Discover it! Enjoy it! Share it! openSUSE Linux.<br>
-----------------------------------------<br>
openSUSE -- <a href="http://en.opensuse.org/User:Terrorpup" target="_blank">en.opensuse.org/User:Terrorpup</a><br>
openSUSE Ambassador/openSUSE Member<br>
Community Manager -- Southeast Linux Foundation (SELF)<br>
skype,twiiter,identica,friendfeed -- terrorpup<br>
freenode(irc) --terrorpup/lupinstein<br>
Register Linux Userid: 155363<br>
<br>
Have you tried SUSE Studio? Need to create a Live CD, an app you want<br>
to package and distribute , or create your own linux distro. Give SUSE<br>
Studio a try. <a href="http://www.susestudio.com" target="_blank">www.susestudio.com</a>.<br>
See you at Southeast Linux Fest, June 7-9, 2013 in Charlotte, NC.<br>
<a href="http://www.southeastlinuxfest.org" target="_blank">www.southeastlinuxfest.org</a><br>
_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org" target="_blank">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>-- <br>James P. Kinney III<br><i><i><i><i><br></i></i></i></i>Every time you stop a school, you will have to build a jail. What you
gain at one end you lose at the other. It's like feeding a dog on his
own tail. It won't fatten the dog.<br>
- Speech 11/23/1900 Mark Twain<br><i><i><i><i><br><a href="http://electjimkinney.org" target="_blank">http://electjimkinney.org</a><br><a href="http://heretothereideas.blogspot.com/" target="_blank">http://heretothereideas.blogspot.com/</a><br>
</i></i></i></i>
<br>_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
<br></blockquote></div>