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

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

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.

Post the crontab line in question and the specific OS involved.

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.

Create a shell script something like:

#! /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.