Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Sep 2006 05:39:20 -0400
From:      Gerard Seibert <gerard@seibercom.net>
To:        freebsd-questions@freebsd.org
Subject:   Re: Default file creation permissions
Message-ID:  <20060921053436.00EA.GERARD@seibercom.net>
In-Reply-To: <8944F1E6DB931D4681FF94706234BF71E95A@BB06.bolsabilbao.local>
References:  <45116D40.7020904@lidstrom.eu> <8944F1E6DB931D4681FF94706234BF71E95A@BB06.bolsabilbao.local>

next in thread | previous in thread | raw e-mail | index | archive | help
Aitor San Juan wrote:

> I have a shell script whose execution is scheduled by CRON. The
> command scheduled is of the form:
>=20
> 50 23 * * 1-5 /apps/batch/cronjobs/bd_backup.sh >
> /apps/batch/logs/bd_backup.log 2>&1
>=20
> This shell script runs under the id of root. The file permissions of
> the log file created are 644 (owner: root, group: wheel). I'd like that
> the file permissions of the log created be 600 (or 640 maximum). How
> could I accomplish this? This is probably related to "umask", but I
> don't dare changing anything in case that change could affect some
> other security configuration as a side effect.
>=20
> What would you recommend?

I have a few shell scripts that are run from CRON also. To accomplish
what you want, I have 'chmod' and 'chown' commands in the scripts.
Perhaps you might be able to incorporate something like that into yours.

--=20
Gerard

     "Health experts in Europe now say one carrot a day can keep you free=
 of
     colon cancer. You know, I just hope they mean you eat it."



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060921053436.00EA.GERARD>