Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] UNIX FTP CMD

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] UNIX FTP CMD
 Login/Join
 
Member
posted
I am on a UNIX Box and I want to do a UNIX ftp command in my fex. I've created a .fex to do this. I've tried different syntex with no luck.

UNIX ftp open server
UNIX userid
UNIX password
UNIX bin
UNIX cd /az/webfocus/ibi/apps
UNIX put test.fex
UNIX close
UNIX quit

I even tried it on one line :
UNIX ftp open server userid password bin cd /az/webfocus/ibi/apps put test.fex close quit
UNIX ftp open server userid password put /az/webfocus/ibi/apps/test.fex /az/webfocus/ibi/apps/testing/text.fex quit

Thanks,
Todd

This message has been edited. Last edited by: Kerry,


7.6.8
UNIX
FOCUS,HTML,PDF,EXCEL.
 
Posts: 18 | Registered: September 29, 2010Report This Post
Guru
posted Hide Post
Put all the ftp commands in an shell script, make sure it is executable, and call that file from your fex.


(Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats)
 
Posts: 391 | Location: California | Registered: April 14, 2003Report This Post
Member
posted Hide Post
Is their a way to do this within the fex?


7.6.8
UNIX
FOCUS,HTML,PDF,EXCEL.
 
Posts: 18 | Registered: September 29, 2010Report This Post
Platinum Member
posted Hide Post
Hi Todd,

Here's an example of one I used in the past.

-*
FILEDEF FTPPUT DISK ftpt0002.txt
-RUN
-*
-WRITE FTPPUT open xyz
-WRITE FTPPUT userid
-WRITE FTPPUT pswd
-WRITE FTPPUT cd /aaa/bbb/ccc
-WRITE FTPPUT put test.fex
-WRITE FTPPUT bye
-CLOSE
DOS ftp -i -s:ftpt0002.txt
-*

I'm not on a UNIX box any more, but this used to work.

Jim


WebFocus 8.201M, Windows, App Studio
 
Posts: 227 | Location: Lincoln Nebraska | Registered: August 12, 2008Report This Post
Platinum Member
posted Hide Post
Hi Todd,

Sorry, I was running on a windows webfocus server, thus the "DOS" command:

DOS ftp -i -s:ftpt0002.txt

I was ftp-ing the file to a UNIX box.

Anyway, maybe the command would look like this:

UNIX ftp -i -s:ftpt0002.txt

Or, better yet, a UNIX person can help us out.

Jim


WebFocus 8.201M, Windows, App Studio
 
Posts: 227 | Location: Lincoln Nebraska | Registered: August 12, 2008Report This Post
Expert
posted Hide Post
fex1 changes the permissions to execute and runs fex2.

fex2 contains the required UNIX commands. (I named it fex2.fex just to make it easier to access in Dev Studio - UNIX can execute a command file with any suffix).

-* File fex1.fex

-SET &ECHO='ALL';

UNIX chmod +x /wf76/ibi/apps/baseapp/fex2.fex
-RUN

UNIX /wf76/ibi/apps/baseapp/fex2.fex
-RUN

----------------------
# File fex2.fex
# UNIX commands go here

whoami

cd /wf76/ibi/ReportCaster76/bin

# Verify if RC is running
netstat -an|grep 8200

You can also create the UNIX command file with -WRITE statements as previously shown.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Member
posted Hide Post
I've tried something like this:

FILEDEF FTPCMDS DISK /az/webfocus/ibi/apps/test/coc.sh
-RUN
-WRITE FTPCMDS open server
-WRITE FTPCMDS user UID PW
-WRITE FTPCMDS bin
-WRITE FTPCMDS send /az/webfocus/ibi/apps/testing/test.fex /az/webfocus/ibi/apps/testing/test.fex
-WRITE FTPCMDS close
-WRITE FTPCMDS bye
-RUN
UNIX /az/webfocus/ibi/apps/test/coc.sh
-RUN



When this runs i get the below error:
UNIX /az/webfocus/ibi/apps/test/coc.sh
-RUN
sh: /az/webfocus/ibi/apps/test/coc.sh: Permission denied


The CHMOD is 777 of the .fex that is creating the file so the coc.sh is also 777.

Any suggestions?
Thanks,
Todd


7.6.8
UNIX
FOCUS,HTML,PDF,EXCEL.
 
Posts: 18 | Registered: September 29, 2010Report This Post
Expert
posted Hide Post
quote:
The CHMOD is 777 of the .fex that is creating the file so the coc.sh is also 777

Are you sure that coc.sh is 777?

I would add
UNIX chmod +x /az/webfocus/ibi/apps/test/coc.sh
-RUN


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Member
posted Hide Post
I get the same results either way, but I did change the -WRITE just a bit.

FILEDEF FTPCMDS DISK /az/webfocus/ibi/apps/test/coc.sh

-RUN
-WRITE FTPCMDS open server
-WRITE FTPCMDS UID
-WRITE FTPCMDS PW
-WRITE FTPCMDS cd /az/webfocus/ibi/apps/test
-WRITE FTPCMDS put coc_tp.fex
-WRITE FTPCMDS bye
-RUN
UNIX chmod +x /az/webfocus/ibi/apps/test/coc.sh
-RUN
-**************************************************************************************************
-**** EXECUTE FTP
UNIX /az/webfocus/ibi/apps/test/coc.sh
-RUN
open: Failed to open /dev/console
: Permission denied
/az/webfocus/ibi/apps/tjones-dev/coc.sh: line 2: UID: command not found
/az/webfocus/ibi/apps/tjones-dev/coc.sh: line 3: PW: command not found
/az/webfocus/ibi/apps/tjones-dev/coc.sh: line 5: put: command not found
/az/webfocus/ibi/apps/tjones-dev/coc.sh: line 6: bye: command not found

This message has been edited. Last edited by: Todd Jones,


7.6.8
UNIX
FOCUS,HTML,PDF,EXCEL.
 
Posts: 18 | Registered: September 29, 2010Report This Post
Virtuoso
posted Hide Post
Maybe instead of asking how to ftp, you should explain the task that you are trying to accomplish here. Looks to me like you want to copy a fex from one server to another. Is that it?


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report This Post
Member
posted Hide Post
dhagen,
You are correct. I really need to move a fex from one server to another.


7.6.8
UNIX
FOCUS,HTML,PDF,EXCEL.
 
Posts: 18 | Registered: September 29, 2010Report This Post
Virtuoso
posted Hide Post
Then:

- add the target server as a remote server to the current one.
- use the EDAPUT command (between a remote begin and remote end) to move the file

You can get the EDAPUT syntax by searching this forum.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report This Post
Master
posted Hide Post
You can use scp - secure copy - (instead of ftp) right in your FEX without the need for a shell script. I have a bunch of them in a separate FEX that I -INCLUDE in other applications.

e.g.:
-UNIX scp -2 USER@123.123.123.123:/home/username/file.txt file.txt


You need to set this up as a trusted connection (so you don't have to supply the password) ahead of time, but after that it works great.

George


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
 
Posts: 674 | Location: Guelph, Ontario, Canada ... In Focus since 1985 | Registered: September 28, 2010Report This Post
Member
posted Hide Post
George,
I was able to get this function to work. Thanks so much!

UNIX scp -2 /az/webfocus/ibi/apps/test/coc_tp.fex UID@SERVERNAME:/az/webfocus/ibi/apps/test/coc_tp.fex

Thanks,
Todd


7.6.8
UNIX
FOCUS,HTML,PDF,EXCEL.
 
Posts: 18 | Registered: September 29, 2010Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] UNIX FTP CMD

Copyright © 1996-2020 Information Builders