Incorrect Permissions on a file

 
Thread Tools Search this Thread
Homework and Emergencies Emergency UNIX and Linux Support Incorrect Permissions on a file
# 1  
Old 04-08-2011
Incorrect Permissions on a file

Hi all,

I am facing a problem currently, with incorrect permissions being set on a file that is being generated automatically.
There is a cronjob which runs for an id uvstart, at 12:30 am ET which generates this file on a particular directory. When the file is generated, it has the permissions of 660. This file is being read by an interfacing application, which SFTPs to my server and picks this file. The permission on the file has to be 666 for the interfacing application to read it. For the past 3 days I log in at 12:30 and manually change the permissions.
The other things which I have tried are:
1) I added a ;chmod 666 <path name> after the entry in the cron job - it did not work
2)I changed the File creation umask for the id uvstart from smitty - that also apparently did not work.

Can someone please help me as to how to fix the permission for the file that gets created(each day a new one) on that particular directory, to be 666

Thanks in advance,

GG
# 2  
Old 04-08-2011
Hi
Could I ask whether the owner of the folder to which you are saving the file is the same as the one running the cronjob? Also what are the permissions on the folder?
Thanks
# 3  
Old 04-08-2011
Owner of the folder is root, and the group is system. It has permissions of drwxrwxrwx.
The id creating the file is uvstart,and the cron job that runs is that of uvstart.
# 4  
Old 04-08-2011
Post the crontab line in question and the specific OS involved.
# 5  
Old 04-08-2011
30 00 * * * /oasis/bin/startPhantom NDRS.ICPM.CRU.DAY IBM.CROSS4 Y 1>/dev/null 2>/dev/null; chmod 666 /ramdisk0/icpm/ndrs/out/cru/*

And the OS is AIX.
# 6  
Old 04-08-2011
Create a shell script something like:
Code:
#! /usr/bin/ksh
umask 0
/oasis/bin/startPhantom NDRS.ICPM.CRU.DAY IBM.CROSS4 Y 1>/dev/null 2>/dev/null
chmod 666 /ramdisk0/icpm/ndrs/out/cru/*
exit 0

Make the script owned by and executable by uvstart. Become uvstart and run the script. If it does not work and you can't fix it, post the results. If it does work, change the crontab to run the script.

The umask command may or may not fix things by itself. But startPhantom may be internally deciding to make the file 660.

That startPhantom may be creating a background job and then exiting. Sometime later the background job finally creates the file. Meanwhile the chmod has already run.

Last edited by Perderabo; 04-08-2011 at 10:54 AM.. Reason: fix umsk
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

SUDOERS file settings Incorrect

1. I have user temp1 belonging to techx group $ id uid=1006(temp1) gid=1002(techx) groups=1002(techx) 2. We have user tomcat belonging to webadm group $ id uid=1017(tomcat) gid=1001(webadm) groups=1001(webadm) 3. We have user root belonging to root group. $ id uid=0(root) gid=0(root)... (2 Replies)
Discussion started by: mohtashims
2 Replies

2. UNIX for Dummies Questions & Answers

ID incorrect field values in dat file and output to new file

Hi All I have a .dat file, the values are seperated by ". I wish to identify all field values in field 14 that are not '01-APR-2013' band then copy those records to a new file. Can anyone suggest the UNIX command required. Thanks in advance Andy (2 Replies)
Discussion started by: aurum1313
2 Replies

3. Shell Programming and Scripting

Changing file permissions of a file created by another user

Hi, I have used expdp for datapump. The .dmp file is created by the "oracle" user. my requirement is to make a zipped file of this .dmp file. What i am trying to do is change the permissions of this .dmp file from 0640 to 0644 and then do a gzip and zip it. Is there any way i can change... (3 Replies)
Discussion started by: qwertyu
3 Replies

4. Shell Programming and Scripting

ksh; Change file permissions, update file, change permissions back?

Hi, I am creating a ksh script to search for a string of text inside files within a directory tree. Some of these file are going to be read/execute only. I know to use chmod to change the permissions of the file, but I want to preserve the original permissions after writing to the file. How can I... (3 Replies)
Discussion started by: right_coaster
3 Replies

5. Shell Programming and Scripting

Merge lines in a file with Awk - incorrect output

Hi, I would like: FastEthernet0/0 is up, line protocol is up 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored 0 output errors, 0 collisions, 0 interface resets Serial1/0:0 is up, line protocol is up 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort 0... (14 Replies)
Discussion started by: mv652
14 Replies

6. Shell Programming and Scripting

Script extracting the incorrect data from text file

Hello, A script has been written to extract a specific column data from a text file ONLY if the user's initial input matches the the data of the first column in the text, then only the data from that row will be prinited. The problem I am having is that the code is only reading the records... (6 Replies)
Discussion started by: jermaine4ever
6 Replies

7. Shell Programming and Scripting

Retain file permissions when saving .sh file from internet [OS X]

Hello. I have written a bash script that I am sharing with an OS X community I am a member of. The purpose of the script is to execute a series of commands for members without them having to get involved with Terminal, as it can be daunting for those with no experience of it at all. I have renamed... (4 Replies)
Discussion started by: baza210
4 Replies

8. HP-UX

To give the "unzip" permissions & "create" file permissions

Hi, I am a Unix Admin. I have to give the permissions to a user for creating new file in a directory in HP-Ux 11.11 system since he cannot able to create a new file in the directory. Thanks in advance. Mike (3 Replies)
Discussion started by: Mike1234
3 Replies

9. Filesystems, Disks and Memory

File Permissions

Hi ; Working off a AIX 4.3. There are three users, root, axel & rose. I have a directory where data is stored owned by root. Now as user axel & rose I cannot cp or mv the files out from this dir, but about a week ago this was possible. 1st Q is why this sudden change. 2nd Q is is there a... (3 Replies)
Discussion started by: buRst
3 Replies
Login or Register to Ask a Question