FTP_GetListing

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

FTP_GetListing

Marc Pope-3
Has anyone had trouble having lasso logging into a FTP server? I can log in
perfectly with Transmit or the Terminal, but not with Lasso. Here's my base
code to do it:

<?Lassoscript

var:'ftp_url'='ftp://ftp.*****.com/';
var:'ftp_usr'='*****';
var:'ftp_pwd'='*****';
   
var:'dirs'=(FTP_GetListing: -URL=$ftp_url,
                            -Username=$ftp_usr,
                            -Password=$ftp_pwd);

iterate: $dirs, var:'date_dirs';
    $date_dirs '<br>';
/iterate;

?>

This code works fine with a different FTP site. The directory has various
folders in it, and I need to go through each folder and download the
content.

Lasso 8.1, Red Hat Linux Enterprise 4

If anyone has any other way to sync ftp content from one server to another
using a cron job, please let me know.

Thanks
Marc Pope









--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: FTP_GetListing

lasso-3
Are you getting any particular error message?

I put your code onto my lasso box and pointed it to my ftp server and
got the following map: (using LP8.1 and Fedora 4 on both boxes - and
several lines removed as well...)

map: (FileSize)=(4096), (FileModDate)=(Fri Oct 28 22:54:00 2005 ),
(FileName)=(xxxx), (FileType)=(Directory)
map: (FileSize)=(1718), (FileModDate)=(Wed Nov 02 22:29:00 2005 ),
(FileName)=(favicon.ico), (FileType)=(File)

I can see that with this as a starting point that it'd be quite easy to
synchronize servers with Lasso and its FTP tags.  Thanks for the idea!  
We have a few servers that need to have the same files on it.  it'll be
nice to have a lasso event do the sync.    Would you like to collaberate
with me on a script to pull files/dirs from a 'master' FTP server?

Cory.

Marc Pope wrote:

>Has anyone had trouble having lasso logging into a FTP server? I can log in
>perfectly with Transmit or the Terminal, but not with Lasso. Here's my base
>code to do it:
>

--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: FTP_GetListing

Jim Van Heule
In reply to this post by Marc Pope-3
Try removing the "ftp://" from the url.

You might also want to do an error check right after the code to see  
what it returns.

--
Jim Van Heule
Heunox Corporation
(616) 844-0066


On Nov 6, 2005, at 7:40 PM, Marc Pope wrote:

> Has anyone had trouble having lasso logging into a FTP server? I  
> can log in
> perfectly with Transmit or the Terminal, but not with Lasso. Here's  
> my base
> code to do it:
>
> <?Lassoscript
>
> var:'ftp_url'='ftp://ftp.*****.com/';
> var:'ftp_usr'='*****';
> var:'ftp_pwd'='*****';
>
> var:'dirs'=(FTP_GetListing: -URL=$ftp_url,
>                             -Username=$ftp_usr,
>                             -Password=$ftp_pwd);
>
> iterate: $dirs, var:'date_dirs';
>     $date_dirs '<br>';
> /iterate;
>
> ?>
>
> This code works fine with a different FTP site. The directory has  
> various
> folders in it, and I need to go through each folder and download the
> content.
>
> Lasso 8.1, Red Hat Linux Enterprise 4
>
> If anyone has any other way to sync ftp content from one server to  
> another
> using a cron job, please let me know.
>
> Thanks
> Marc Pope
>
>
>
>
>
>
>
>
>
> --
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription:
> http://www.listsearch.com/lassotalk.lasso?manage


--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage