Date: Thu, 21 Sep 2006 12:02:15 +0200 From: "Aitor San Juan" <asanjuan@bolsabilbao.es> To: <freebsd-questions@freebsd.org> Subject: RE: Default file creation permissions Message-ID: <8944F1E6DB931D4681FF94706234BF71E9E3@BB06.bolsabilbao.local> In-Reply-To: <20060921053436.00EA.GERARD@seibercom.net>
next in thread | previous in thread | raw e-mail | index | archive | help
Thanks for your reply, Gerard. As you can see, the log file is not created from within the shell = script. It's created as the redirection of the output, so your = suggestion implies modifying the shell script source code. That script = calls some other scripts too and imports other scripts which define some = predefined common functions with common behaviour among all the shell = scripts developed. This means that is this case the backup script is = called by CRON but there's also the possibility of invoking it manually = (for example in the need of a backup out of the normal scheduled time). = When invoked manually, the results are shown in the screen to the = user... You know, the script is not isolated, it's part of a bigger = infrastructure behinf the scene, hidden to some users which may invoke = batch script from within menus (with no command line access). I'd like to find another solution, having to modify the shell script in = the last resort. Thanks in advance. -----Mensaje original----- De: owner-freebsd-questions@freebsd.org [mailto:owner-freebsd-questions@freebsd.org]En nombre de Gerard Seibert Enviado el: jueves, 21 de septiembre de 2006 11:39 Para: freebsd-questions@freebsd.org Asunto: Re: Default file creation permissions 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 ************ LEGEZKO OHARRA / AVISO LEGAL / LEGAL ADVICE *************=20 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.=20 -------------------------------------------------------------------------= - Este mensaje puede contener informaci=C3=B3n 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=C3=A1 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. *************************************************************************= *
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8944F1E6DB931D4681FF94706234BF71E9E3>