ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bozorgdadeh, Afshin" <>
Subject RE: Backup before deploy
Date Tue, 22 Nov 2005 16:30:11 GMT
My last 2cents
You could get the job done or you could just brain storm about it.
When you are su to a different user you are creating a chilled process,
so your script has to have a way to communicate with a child process. In
the good old day there was a scripting language name "EXPECT" which
could pass the arguments to the chilled process. But I think you problem
is much simpler than that. Let's break it up in two sections.
Second section first.

2) tar and gzip files with a to privileged restricted location allowed.
    There is a concept of "sticky bit" in UNIX you could create a script
that will run as a privileged user. But anybody could run that scrip.
   # script to backup file as BIG DUDE
   # scrip name =
   tar cvf /BackupDirectory/Mydailybakup.tar    /sorce/needto/bakup/*
   gzip /BackupDirectory/Mydailybakup.tar    

after saving this file you have to make this a sticky bit it
   login as the priviladged user and > chmod 4755

Now we are going to do the 1st part
<sshexec host="Host we are going to run the script on"

Good luck

Best Regards
Afshin Bozorgzadeh
>Fidelity Investments Brokerage Company 
>FBCT ClearCase Release Engineer
Phone           603-791-5596
BlackBerry  603-365-0205

-----Original Message-----
From: Jakob Fix [] 
Sent: Tuesday, November 22, 2005 10:56 AM
To: Ant Users List
Subject: Re: Backup before deploy


On 22/11/05, keith wong <> 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


>  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


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message