Default file creation permissions

Aitor San Juan asanjuan at bolsabilbao.es
Thu Sep 21 00:17:20 PDT 2006


Hi List,

I have a shell script whose execution is scheduled by CRON. The command scheduled is of the form:

50 23 * * 1-5 /apps/batch/cronjobs/bd_backup.sh > /apps/batch/logs/bd_backup.log 2>&1

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.

What would you recommend?

Any hint or suggestion would be highly appreciated.

Thanks in advance.

Aitor.


************ LEGEZKO OHARRA / AVISO LEGAL / LEGAL ADVICE ************* 
Mezu honek isilpeko informazioa gorde dezake, edo jabea duena, edota legez babestuta dagoena. Zuri zuzendua ez bada, bidali duenari esan eta ezabatu, inori berbidali edo gorde gabe, legeak debekatzen duelako mezuak erabiltzea baimenik gabe. 
--------------------------------------------------------------------------
Este mensaje puede contener información confidencial, en propiedad o legalmente protegida. Si usted no es el destinatario, le rogamos lo comunique al remitente y proceda a borrarlo, sin reenviarlo ni conservarlo, ya que su uso no autorizado está prohibido legalmente.
--------------------------------------------------------------------------
This message may contain confidential, proprietary or legally privileged information. If you are not the intended recipient of this message, please notify it to the sender and delete without resending or backing it, as it is legally prohibited.
**************************************************************************


More information about the freebsd-questions mailing list