ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anderson, Rob (Global Trade)" <Rob.Ander...@nike.com>
Subject RE: Backup before deploy
Date Tue, 22 Nov 2005 17:39:03 GMT
You should setup sudo on the remote side to allow you to execute the
commands you need to run as the user you need to run them as. 

The command in the ant sshexec task would look something like this:
<sshexec host="somehost"
...
	command="cd /path/to/somefiles ; sudo rm ../archive.tar.gz ;
sudo tar zcf ../archive.tar.gz * "/>

Check out the sudo manual...
http://www.courtesan.com/sudo/

-Rob Anderson



> -----Original Message-----
> From: keith wong [mailto:ckeiwong@yahoo.com] 
> Sent: Monday, November 21, 2005 4:02 PM
> To: user@ant.apache.org
> Subject: Backup before deploy
> 
> Hello,
> I need control remote host thru ssh to tar all backup file, 
> but I get into problem of "su - " command after ant <sshexec> 
> in. I not sure how to keep ssh session and process two steps 
> command to archive. Here is steps I need to make:
>  1. SSH to remote.
>  2. su to our user. 
>  3. tar all backup and save it to privielge  restricted 
> location allowed  from that "su"ed user.
>  4. compress the tar to save space.
>  
>  Thank you for any input.
>  
>  Regards,
>  Keith
> 
> 
> 		
> __________________________________
> Yahoo! FareChase: Search multiple travel sites in one click.
> http://farechase.yahoo.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For 
> additional commands, e-mail: user-help@ant.apache.org
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message