I would use rsync for this. <br><br>At the least, loop through the FILE= to build a list. What's happening is touch3 overwrites touch2 which overwrites touch1.<br><br>for myfile in $(ls -rt <path>/<file_pattern>); do FILE="${FILE} ${myfile}"; done<br>
do ftp and add -i flag so multiple files can be pushed up at once without prompting when using mput instead of put.<br><br><div class="gmail_quote">On Wed, Jan 16, 2013 at 10:37 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">Guys,<br>
<br>
I have a question, I have a very simple ftp script<br>
<br>
-----------------Script Begins----------------------------<br>
<br>
#!/bin/bash<br>
# To find the latest files and upload them to process server<br>
<br>
FILE=$(ls -rt /chroot/home/fl/fl_sdirc | awk 'END{ print $NF }')<br>
ftp -n 192.168.0.8 <<+<br>
user user password<br>
binary<br>
put $FILE<br>
quit<br>
<br>
------------------Script Ends---------------------------------------<br>
<br>
But, I think my script is limited and might not have a way to check if<br>
files have been uploaded and might not get all the<br>
<br>
This line seems to only return one file<br>
<br>
ls -rt /chroot/home/fl/fl_sdirc | awk 'END{ print $NF }'<br>
<br>
I did this as a test, I ran the following command<br>
<br>
touch touch1<br>
touch touch2<br>
touch touch3<br>
<br>
but only returns touch3, not touch1, touch2 where only seconds part.<br>
If that the case, my script will miss uploading files. Is there a<br>
better way of doing this? I know there is. just I'm bit brain dead<br>
trying think of a good way. I could set up a log and move files, but<br>
that will break my KISS rule, or do I need that to make it work.<br>
<br>
--<br>
Terror PUP a.k.a<br>
Chuck "PUP" Payne<br>
<br>
<a href="tel:%28678%29%20636-9678" value="+16786369678">(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">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>
</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>