[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: cron & file permissions



Mike McClain <mike.junk@nethere.com> wrote:
> /mc/bin/daily sets umask
> umask 037                       #   save files rw owner, group read only

> then runs a script like so:
> [ -e /mc/bin/secure ] && /mc/bin/secure 2>&1 | tee /root/sysstats/secure.log

You want the output to go to the cron email as well as to the log file?


> but the permissions on secure.log come out 600:
> root@/deb60:~> ls -l sysstats/secure.log
> -rw------- 1 root root 67832 Jul 18 02:01 sysstats/secure.log

> What do I need to do to make secure.log permissions come out 640?

The permissions from umask are only applied to files that are created. If
sysstats/secure.log already exists they won't be changed.

Either delete the file and wait for your cron job to re-create it,
or fix up the permissions manually.

Chris


Reply to: