Re: Batch file Permissions

  • From: Balakrishna Y <krishna000@xxxxxxxxx>
  • To: "Bobak, Mark" <Mark.Bobak@xxxxxxxxxxxx>
  • Date: Fri, 18 Sep 2009 08:48:42 +0530

Hi all,

Thanks for your response . The real problem is we dont have any sys admins
over here we should take care of every thing , thats why i seeking some
help.

We have Oracle applications to few files it requires execute permissions and
so inorder to automate ftp from windows to linux i just take wanted to do
that .

Regards

Bala

On Thu, Sep 17, 2009 at 10:42 PM, Bobak, Mark <Mark.Bobak@xxxxxxxxxxxx>wrote:

> Argh, you're absolutely right!  Sorry for the typo!
>
> And I thought I proofread it before I hit send!  ;-)
>
> -Mark
>
> -----Original Message-----
> From: D'Hooge Freek [mailto:Freek.DHooge@xxxxxxxxx]
> Sent: Thursday, September 17, 2009 1:10 PM
> To: Bobak, Mark; Richard.Goulet@xxxxxxxxxxx; krishna000@xxxxxxxxx;
> oracle-l@xxxxxxxxxxxxx
> Subject: RE: Batch file Permissions
>
> Marc,
>
> "For a file, default permissions are 666, anded w/ umask of 022, you get
> 666&022 = 644 = -rw-rw-rw-"
>
> 644 would be "rw-r--r--" not "-rw-rw-rw-"
>
>
> Regards,
>
> Freek D'Hooge
> Uptime
> Oracle Database Administrator
> email: freek.dhooge@xxxxxxxxx
> tel +32(0)3 451 23 82
> http://www.uptime.be
> disclaimer
>
>
> ________________________________________
> From: oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx]
> On Behalf Of Bobak, Mark
> Sent: donderdag 17 september 2009 18:56
> To: Richard.Goulet@xxxxxxxxxxx; krishna000@xxxxxxxxx;
> oracle-l@xxxxxxxxxxxxx
> Subject: RE: Batch file Permissions
>
> Hi Bala,
>
> A minor correction to Dick's comment, -rw-r--r-- is 644 not 344.
>
> Default file permissions are controlled by the umask of the process
> creating the file.  The default umask is 022.  That gets and'ed with the
> default permissions for a file and a directory.
> For a file, default permissions are 666, anded w/ umask of 022, you get
> 666&022 = 644 = -rw-rw-rw-
> For a directory, default permissions are 777, anded w/ umask of 022, you
> get 777&022 = 755 = drwxr-xr-x
>
> The important point though, is that you'll never be able to get 755 on a
> file by default.  Since the default permission, without any umask at all, is
> 666, the most permissive you can get is 666, if you set umask to 000.
>
> I think this is a security thing.  If you want a file to be executable, you
> need to explicitly set it as such.  It will never happen by accident or
> default.
>
> Finally, if you need to change the umask for your ftp daemon, you'll need
> to work with your sysadmin to make the change in the /etc/init.d script that
> starts your ftp daemon, in order for it to see the change to the umask
> value.
>
> Hope that helps,
>
> -Mark
>
> From: oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx]
> On Behalf Of Goulet, Richard
> Sent: Thursday, September 17, 2009 12:36 PM
> To: krishna000@xxxxxxxxx; oracle-l@xxxxxxxxxxxxx
> Subject: RE: Batch file Permissions
>
> Bala,
>
>    I've tried ftp commands to a couple of the linux/unix servers we have
> here.  The file gets there with a file mask of 344 (-rwr--r--) is my math is
> right.  Why would you need to have them as 755 (-rwxr-xr-x) if it's a daily
> process??
>
> Dick Goulet
> Senior Oracle DBA/NA Team Lead
> PAREXEL International
>
>
> ________________________________________
> From: oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx]
> On Behalf Of Balakrishna Y
> Sent: Wednesday, September 16, 2009 11:34 PM
> To: oracle-l@xxxxxxxxxxxxx
> Subject: Batch file Permissions
> Hi all,
>
> I am trying to automate ftp from windows to Linux machine.
>
> My Batch file looks like this . The problem is by default while shipping
> the file i wanted to give permissions to files as 755 . Can any one help me
> out .
>
> @echo off
> SET CUSTOM=/apps12i/oracle/KIRAN/
> apps/apps_st/appl/custom/12.0.0/reports/US
> echo user oracle> ftpcmd.dat
> echo passwd >> ftpcmd.dat
> echo bin>> ftpcmd.dat
> echo cd %1 >>ftpcmd.dat
> echo put %2 >> ftpcmd.dat
> echo quit>> ftpcmd.dat
> ftp -n -s:ftpcmd.dat ipaddress
> del ftpcmd.dat
>
> Regards
>
> Bala
>
>
>

Other related posts: