You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by keith wong <ck...@yahoo.com> on 2005/11/22 01:01:37 UTC
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
Re: Backup before deploy
Posted by Jakob Fix <ja...@gmail.com>.
Keith,
On 22/11/05, keith wong <ck...@yahoo.com> wrote:
> 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.
not sure how to do this ant (haven't looked at the documentation), but
I would probably
ssh -l theRemoteUserName
to the remote site. Of course, it would be bad practice to ssh as root ...
HTH
> 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
>
>
>
--
cheers,
Jakob.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Backup before deploy
Posted by Gisbert Amm <gi...@webde.de>.
keith wong wrote:
> 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.
You could pass your tar command to su with the -c option (-c,
--commmand=COMMAND pass a single COMMAND to the shell with -c). Since
tar itself got a zip option (z) you could do the 3rd and 4th step
simultaniously.
Not very Ant-ish indeed, but a possibility.
Regards,
Gisbert
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org