Gentoo Archives: gentoo-user

From: Stroller <stroller@××××××××××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Disable fcron logging
Date: Sun, 22 Aug 2010 19:50:40
Message-Id: 0B6CFC07-0059-4EB8-903D-2717B38BB0A6@stellar.eclipse.co.uk
In Reply to: Re: [gentoo-user] Disable fcron logging by Stroller
1 On 22 Aug 2010, at 20:00, Stroller wrote:
2 > On 22 Aug 2010, at 11:26, Alex Schuster wrote:
3 >> Stroller writes:
4 >>>
5 >>>
6 >>> #!/bin/bash
7 >>> while true
8 >>> do
9 >>> for drive in a b c d
10 >>> do
11 >>> /usr/sbin/smartctl /dev/sd$drive --whatever >> /var/log/hdstate
12 >>> done
13 >>> sleep 60
14 >>> done
15 >>
16 >> I use hdparm and hddtemp:
17 >>
18 >> for hd in sda sdb sdc sdd
19 >> do
20 >> ...
21 >> echo "$hd: $state $temp"
22 >> done
23 >
24 > The script with which you reply is missing the sleep 60 loop.
25 >
26 >> ...
27 >> The problem with cron is that I get those cron logs I do not like,
28 >> and
29 >> that the update time of 60 seconds is a little long. Running the
30 >> script in
31 >> a loop, started in .kde4/Autostart, would be better, but as a user
32 >> I have
33 >> no permission to call hdparm or hdtemp. I do not want to be part of
34 >> the
35 >> disk group, and when using sudo I would get the logs by sudo I
36 >> wanted to
37 >> avoid. So now I SUID'ed hdparm and hddtemp, changed the group to
38 >> wheel and
39 >> disabled execution for others. cron problem not solved, but
40 >> workarounded.
41 >
42 > Running a script which contains `while true ... sleep 60` will cause
43 > only a single logging action. You can run it as root at startup
44 > using /etc/conf.d/local.start and have the file world readable.
45
46 Sorry, this wasn't very clear:
47
48 If your script contains `while true ... sleep 60` then you'll only
49 need to run it once.
50
51 Stroller.