Re: Can I change group and permissions on the messages file?
- From: "Chris F.A. Johnson" <cfajohnson@xxxxxxxxx>
- Date: Sun, 24 Sep 2006 21:44:48 -0400
On 2006-09-25, Ohmster wrote:
Bit Twister <BitTwister@xxxxxxxxxxxxxxxx> wrote in
news:slrnehe7cr.u2.BitTwister@xxxxxxxxxxxxxxx:
Do not run FCx myself but you could create a script in
/etc/cron.daily to check/change it to whatever you like.
#********* start of my_kludge **************
_var_fn=/var/log/messages
_priv=$(/bin/stat -c %a $_var_fn)
if [ $_priv -ne 640 ] ; then
/bin/chmod 640 $_var_fn
fi
#************** end my_kludge *********************
I just put your script in an executable text file and tried it out, no
good, it will not work.
[root@ohmster scripts]# /root/scripts/change_messages_perms
/root/scripts/change_messages_perms: line 4: /bin/stat: No such file or
directory
Do NOT use the full path to a system executable (use stat rather
than /bin/stat; the same for chmod). Such files will be in your
PATH (unless you've screwed it up), but not all systems have them
in the same place; stat is not a standard command, so FC3 could
place it somewhere else.
/root/scripts/change_messages_perms: line 6: [: -ne: unary operator
expected
[root@ohmster scripts]#
Well it looked pretty cool anyway.
--
Chris F.A. Johnson, author | <http://cfaj.freeshell.org>
Shell Scripting Recipes: | My code in this post, if any,
A Problem-Solution Approach | is released under the
2005, Apress | GNU General Public Licence
.
- Follow-Ups:
- Re: Can I change group and permissions on the messages file?
- From: Ohmster
- Re: Can I change group and permissions on the messages file?
- From: Bit Twister
- Re: Can I change group and permissions on the messages file?
- References:
- Can I change group and permissions on the messages file?
- From: The Ohmster
- Re: Can I change group and permissions on the messages file?
- From: Ohmster
- Re: Can I change group and permissions on the messages file?
- From: Bit Twister
- Re: Can I change group and permissions on the messages file?
- From: Ohmster
- Can I change group and permissions on the messages file?
- Prev by Date: Re: Can I change group and permissions on the messages file?
- Next by Date: Re: Can I change group and permissions on the messages file?
- Previous by thread: Re: Can I change group and permissions on the messages file?
- Next by thread: Re: Can I change group and permissions on the messages file?
- Index(es):
Relevant Pages
|