Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Remote deployment to a unix server using FTP task in ANT

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I want to deploy my tar file on a remote unix server using the FTP task provided by ANT.For doing this I need to connect to a particular unix host and then acquire the superuser status by doing su - username and password as only the superuser has the access to copy any files to the runtime environment.

Presently I am able establish a connection to the remote host with my userid and password but I dont know then how to switch to superuser id and password before trying to deploy my file by copying it to the correct location on the server..???

My target for this deployment looks like this -

<target name="deploy"
depends="create_dam"
description="Deploy the tar file on to the deployment environment">
<ftp
action = "put"
server = "${Server.Address}"
remotedir = "${remote.dir}"
userid = "${user.id}"
password = "${password}">
<!-- here I need some code to become superuser -->

<fileset dir ="${dist.dir}">
<patternset refid="tar.patternset"/>
</fileset>
</ftp>
</target>

Can anyone guide me on the same??
Thanks in advance...
Sumit
 
Bartender
Posts: 2658
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could upload the files to your unix home directory using the ftp task,

and then deploy it from the unix server via the telnet task.
With the telnet task you can execute the su command, and then move the files from your home dir to the deployment dir.

Regards, Jan

(Maybe your ftp server supports the "quote site [command] [parameters]" command?)
 
Sumit Ranjan
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could upload the files to your unix home directory using the ftp task,

and then deploy it from the unix server via the telnet task.
With the telnet task you can execute the su command, and then move the files from your home dir to the deployment dir.

Regards, Jan

(Maybe your ftp server supports the "quote site [command] [parameters]" command?)
----------------------------------------------------------------------------

Hi Jan,

First of all thanks a lot for your valuable suggestions.. Using your suggestion I was able to ftp the tar file to my home directory but I still have this doubt as to how to login to a unix host as a superuser using telnet task and then copy the tar file from home directory to the required Server's runtime environment. Can you please give some sort of example for the same if it is possible for you... This is the first time I am dealing with remote deployment of tar files.. so I dont know much..!!!

Thanks a lot in advance,
Sumit
 
Jan Cumps
Bartender
Posts: 2658
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the telnet task, you can execute any unix command.
Example:

Ask your unix administrator for the command to become a superuser.
 
Rototillers convert rich soil into dirt. Please note that this tiny ad is not a rototiller:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic