SCO 5.0.7 Cron creates files with 600, need 644


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers SCO 5.0.7 Cron creates files with 600, need 644
# 1  
Old 01-21-2009
SCO 5.0.7 Cron creates files with 600, need 644

Hi,

I've searched and read, and searched and read some more; but I'm still not connecting the dots or understanding what I need to change.

I have a script that creates a file. If I run it as root, the file gets created with 644 permissions like I want. That seems to make sense (at least I think Smilie ), as when I type umask, it returns 022. So, new files would be created with 666, but the 022 umask is being applied against it and resulting in a file with 644.

However, if I run it from cron, the file gets created as 600. Like there is an 066 umask being applied against it. Is it simply that there's a different umask in force for files created by cron? If so, where would I find and edit it?

Or is it a matter of the permissions on crontab itself? The one in /usr/bin and /ibin are both owned by root, with a group of root and both have 777 permssions.

There's a lot of info out there on cron jobs and permissions, but most seems centered around the cron job not running. Mine runs, it's just creating files with different permissions than I.

Any input is appreciated.

Thanks,
David
# 2  
Old 01-29-2009
Hrm, you can try launching the cron daemon like this:
Code:
umask 022
crond

to see if that changes things.

If not, you can just change every cron job:
Code:
0,30 * * * * { umask 022; run-job.sh }

# 3  
Old 02-03-2009
Thanks, I'll give that a try
 
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Convert creates multiple files

I want to crop an image and am using convert convert mountain.png -crop 3000x4500 +repage -format png mountain--cr.png The problem is that convert is creating 4 files mountain--cr-0.png mountain--cr-1.png mountain--cr-2.png mountain--cr-3.png The first is what I need, the other... (10 Replies)
Discussion started by: Kangol
10 Replies

2. AIX

How to create all files generated in a directory with 644 permissions?

Hi, We are using AIX machines. How to create all files generated in a directory with 644 permissions automatically. Regards, Suresh (11 Replies)
Discussion started by: suresh3566
11 Replies

3. UNIX for Advanced & Expert Users

Allow user without dir write permission to execute a script that creates files

In our project we have several unix scripts that trigger different processes. These scripts write logs to a particular folder 'sesslogs', create output data files in a separate directory called 'datafiles' etc. Usually L1 support team re-run these scripts . We donot want L1 support team to have... (14 Replies)
Discussion started by: waavman
14 Replies

4. UNIX for Dummies Questions & Answers

naming files that csplit creates

Hi, This is my first time on this forum.. I searched the previous answers, but didn't find the answer I was looking for at first glance. csplit works beautifully for me, except for one thing. My file looks like this: ad|name1|asdf...(several pages)..asdf ... ad|name2|asdf...(several... (8 Replies)
Discussion started by: juliette salexa
8 Replies

5. Shell Programming and Scripting

write script for more then 600 files

Hi, i have 600 or more file on my server and from this 600 files i want to make one file. i have written this script SPATH=/etlstg/DAT TPATH=/etlstg/DAT/DAT_PROCESSED FILE_DATE=`TZ=CST+24 date +20%y%m%d` a1=0 while do a2=0 while do a3=0 while ... (1 Reply)
Discussion started by: prasson_ibm
1 Replies

6. Windows & DOS: Issues & Discussions

gVim creates and leaves strange tilde ~ files in Windows

Hey folks, I have used gVim in Windows for many years but I have never found an answer to a very simple question I am going to ask you guys... My question is if there is a way to eliminate the creation of those ~ files that gVim creates in Windows. If you have ever used gVim in Windows you... (2 Replies)
Discussion started by: ghbarratt
2 Replies
Login or Register to Ask a Question