[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] Question about ftp'ing files
- Subject: [ale] Question about ftp'ing files
- From: stevejunk at iintiip.com (Steve Tynor)
- Date: Thu, 17 Jan 2013 06:47:07 -0500
- In-reply-to: <CAPfJb3rFpZPMpx7Fue1+v5cSdqyrn-=sH7d8LxfhAQkAhkpYLA@mail.gmail.com>
- References: <CAPfJb3rFpZPMpx7Fue1+v5cSdqyrn-=sH7d8LxfhAQkAhkpYLA@mail.gmail.com>
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.
>