[ale] Question about ftp'ing files

Steve Tynor stevejunk at iintiip.com
Thu Jan 17 06:47:07 EST 2013


Consider using "sitecopy" (http://www.manyfish.co.uk/sitecopy) - I use 
it to keep various websites in sync w/ a local source tree. Think of it 
as a rsync-like utility built on top of ftp.  Google shows Ubuntu and 
Fedora packages available for normal installs.

Steve


On 1/16/2013 10:37 PM, Chuck Payne wrote:
> Guys,
>
> I have a question, I have a very simple ftp script
>
> -----------------Script Begins----------------------------
>
> #!/bin/bash
> # To find the latest files and upload them to process server
>
> FILE=$(ls -rt /chroot/home/fl/fl_sdirc | awk 'END{ print $NF }')
> ftp -n 192.168.0.8 <<+
> user user password
> binary
> put $FILE
> quit
>
> ------------------Script Ends---------------------------------------
>
> But, I think my script is limited and might not have a way to check if
> files have been uploaded and might not get all the
>
> This line seems to only return one file
>
> ls -rt /chroot/home/fl/fl_sdirc | awk 'END{ print $NF }'
>
> I did this as a test, I ran the following command
>
> touch touch1
> touch touch2
> touch touch3
>
> but only returns touch3, not touch1, touch2 where only seconds part.
> If that the case, my script will miss uploading files. Is there a
> better way of doing this? I know there is. just I'm bit brain dead
> trying think of a good way. I could set up a log and move files, but
> that will break my KISS rule, or do I need that to make it work.
>



More information about the Ale mailing list