Jazz Register Log in
Jazz Forum Welcome to the Jazz Community Forum

Welcome to the Jazz Community Forum

Connect and collaborate with IBM Engineering experts and users

Store multiple FTP credentials in environment vars

In my current project we have to do 400 put operations (FTP) each day. Currently we have a script that reads server, user and password information from a text file. Then we have another txt file that contains the files we want to move and the server we want to put them (could be a different server for each file).

What I want to do is replace that script with a BuildForge project. I can't find a way of loading all the FTP login credentials into an environment and then use the appropiate one in the "put" step.

Let's say I have ServerA and ServerB login credentials, how can I use ServerA info if the current file is going there?

Thanks!

0 votes



3 answers

Permanent link
In my current project we have to do 400 put operations (FTP) each day. Currently we have a script that reads server, user and password information from a text file. Then we have another txt file that contains the files we want to move and the server we want to put them (could be a different server for each file).

What I want to do is replace that script with a BuildForge project. I can't find a way of loading all the FTP login credentials into an environment and then use the appropiate one in the "put" step.

Let's say I have ServerA and ServerB login credentials, how can I use ServerA info if the current file is going there?

Thanks!


the best solution for this is a .netrc file on the ftp client system.
http://www.manpages.info/sunos/netrc.4.html

you could store all the credentials in the file, or have the step create one on the fly from the env group where you store them.

0 votes


Permanent link

the best solution for this is a .netrc file on the ftp client system.
http://www.manpages.info/sunos/netrc.4.html

you could store all the credentials in the file, or have the step create one on the fly from the env group where you store them.


I'll probably create the file on the fly, any idea how to iterate over all environment variables? What would be the best way of storing 30 login credentials (server-user-password) on an environment?

Thank you!

0 votes


Permanent link

the best solution for this is a .netrc file on the ftp client system.
http://www.manpages.info/sunos/netrc.4.html

you could store all the credentials in the file, or have the step create one on the fly from the env group where you store them.


I'll probably create the file on the fly, any idea how to iterate over all environment variables? What would be the best way of storing 30 login credentials (server-user-password) on an environment?

Thank you!
as for the best way to store the credentials, I'd store the whole .netrc line in the env var. That simplifies storage as well as extraction.

I'd create them with similar names, something like using a common prefix of FTPAUTH_ and using a shell script to access then in the environment. Something like:
set | grep FTPAUTH_|cut -f2 -d= > $HOME/.netrc

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Dec 22 '10, 8:29 a.m.

Question was seen: 4,866 times

Last updated: Dec 22 '10, 8:29 a.m.

Confirmation Cancel Confirm