daily.output and ROOTBACKUP

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

daily.output and ROOTBACKUP

Peter Bisroev-2
Hi All,

This is a very minor issue, and I could possibly have missed something in the
documentation since I do not see people asking this question on the mailing
lists. So if someone could point me in the right direction it would be really
appreciated.

I am using OpenBSD 5.2 on a number of hosts, and all works great. I have
daily.local setup as follows:

--------------------------------------------------
cat /etc/daily.local
ROOTBACKUP=1
VERBOSESTATUS=0
--------------------------------------------------

Normal daily output is not emailed, however because I do have ROOTBACKUP=1 I
get daily emails about root backups as shown below:

--------------------------------------------------
OpenBSD 5.2 (GENERIC.MP) #368: Wed Aug  1 10:04:49 MDT 2012
    [hidden email]:/usr/src/sys/arch/amd64/compile/GENERIC.MP

 1:31AM  up 24 days,  1:40, 0 users, load averages: 0.78, 0.28, 0.15

Backing up root=/dev/rwd0a to /dev/rwd0d:
131527+0 records in
131527+0 records out
1077469184 bytes transferred in 57.954 secs (18591693 bytes/sec)
** /dev/rwd0d
** Last Mounted on /
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
1756 files, 26205 used, 490058 free (50 frags, 61251 blocks, 0.0% fragmentation)

MARK FILE SYSTEM CLEAN? yes


***** FILE SYSTEM WAS MODIFIED *****
--------------------------------------------------

The reason that I am getting this output makes sense, since the daily manpage
states:

--------------------------------------------------
If set to 0, df(1), dump(8), netstat(1), and ruptime(1)
are skipped.  Consequently, if none of the other
commands produce any output, no mail will be sent to
root.
--------------------------------------------------

So what would be the correct way to instruct the rootbackup process not to
produce output unless something is wrong?

Thank you!
--peter

Reply | Threaded
Open this post in threaded view
|

Re: daily.output and ROOTBACKUP

Wesley MOUEDINE ASSABY
Hi

'man 5 crontab' give :
Command output is mailed to the crontab owner

It is why you have root emails...(root backups are provided from
security scripts (from daily))

Cheers,

Wesley

Le 2013-02-04 20:03, Peter Bisroev a écrit :

> Hi All,
>
> This is a very minor issue, and I could possibly have missed
> something in the
> documentation since I do not see people asking this question on the
> mailing
> lists. So if someone could point me in the right direction it would
> be really
> appreciated.
>
> I am using OpenBSD 5.2 on a number of hosts, and all works great. I
> have
> daily.local setup as follows:
>
> --------------------------------------------------
> cat /etc/daily.local
> ROOTBACKUP=1
> VERBOSESTATUS=0
> --------------------------------------------------
>
> Normal daily output is not emailed, however because I do have
> ROOTBACKUP=1 I
> get daily emails about root backups as shown below:
>
> --------------------------------------------------
> OpenBSD 5.2 (GENERIC.MP) #368: Wed Aug  1 10:04:49 MDT 2012
>    
> [hidden email]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
>
>  1:31AM  up 24 days,  1:40, 0 users, load averages: 0.78, 0.28, 0.15
>
> Backing up root=/dev/rwd0a to /dev/rwd0d:
> 131527+0 records in
> 131527+0 records out
> 1077469184 bytes transferred in 57.954 secs (18591693 bytes/sec)
> ** /dev/rwd0d
> ** Last Mounted on /
> ** Phase 1 - Check Blocks and Sizes
> ** Phase 2 - Check Pathnames
> ** Phase 3 - Check Connectivity
> ** Phase 4 - Check Reference Counts
> ** Phase 5 - Check Cyl groups
> 1756 files, 26205 used, 490058 free (50 frags, 61251 blocks, 0.0%
> fragmentation)
>
> MARK FILE SYSTEM CLEAN? yes
>
>
> ***** FILE SYSTEM WAS MODIFIED *****
> --------------------------------------------------
>
> The reason that I am getting this output makes sense, since the daily
> manpage
> states:
>
> --------------------------------------------------
> If set to 0, df(1), dump(8), netstat(1), and ruptime(1)
> are skipped.  Consequently, if none of the other
> commands produce any output, no mail will be sent to
> root.
> --------------------------------------------------
>
> So what would be the correct way to instruct the rootbackup process
> not to
> produce output unless something is wrong?
>
> Thank you!
> --peter

Reply | Threaded
Open this post in threaded view
|

Re: daily.output and ROOTBACKUP

Alexander Hall
"Wesley M.A." <[hidden email]> wrote:

>Hi
>
>'man 5 crontab' give :
>Command output is mailed to the crontab owner

True but irrelevant here. The daily cronjob and friends shouldn't pass anything on stdout or stderr, but mails it themselves.

On the subject, I dont think there is a simple way to quiet it apart from editing the scripts.

/Alexander

>It is why you have root emails...(root backups are provided from
>security scripts (from daily))
>
>Cheers,
>
>Wesley
>
>Le 2013-02-04 20:03, Peter Bisroev a écrit :
>> Hi All,
>>
>> This is a very minor issue, and I could possibly have missed
>> something in the
>> documentation since I do not see people asking this question on the
>> mailing
>> lists. So if someone could point me in the right direction it would
>> be really
>> appreciated.
>>
>> I am using OpenBSD 5.2 on a number of hosts, and all works great. I
>> have
>> daily.local setup as follows:
>>
>> --------------------------------------------------
>> cat /etc/daily.local
>> ROOTBACKUP=1
>> VERBOSESTATUS=0
>> --------------------------------------------------
>>
>> Normal daily output is not emailed, however because I do have
>> ROOTBACKUP=1 I
>> get daily emails about root backups as shown below:
>>
>> --------------------------------------------------
>> OpenBSD 5.2 (GENERIC.MP) #368: Wed Aug  1 10:04:49 MDT 2012
>>    
>> [hidden email]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
>>
>>  1:31AM  up 24 days,  1:40, 0 users, load averages: 0.78, 0.28, 0.15
>>
>> Backing up root=/dev/rwd0a to /dev/rwd0d:
>> 131527+0 records in
>> 131527+0 records out
>> 1077469184 bytes transferred in 57.954 secs (18591693 bytes/sec)
>> ** /dev/rwd0d
>> ** Last Mounted on /
>> ** Phase 1 - Check Blocks and Sizes
>> ** Phase 2 - Check Pathnames
>> ** Phase 3 - Check Connectivity
>> ** Phase 4 - Check Reference Counts
>> ** Phase 5 - Check Cyl groups
>> 1756 files, 26205 used, 490058 free (50 frags, 61251 blocks, 0.0%
>> fragmentation)
>>
>> MARK FILE SYSTEM CLEAN? yes
>>
>>
>> ***** FILE SYSTEM WAS MODIFIED *****
>> --------------------------------------------------
>>
>> The reason that I am getting this output makes sense, since the daily
>
>> manpage
>> states:
>>
>> --------------------------------------------------
>> If set to 0, df(1), dump(8), netstat(1), and ruptime(1)
>> are skipped.  Consequently, if none of the other
>> commands produce any output, no mail will be sent to
>> root.
>> --------------------------------------------------
>>
>> So what would be the correct way to instruct the rootbackup process
>> not to
>> produce output unless something is wrong?
>>
>> Thank you!
>> --peter

Reply | Threaded
Open this post in threaded view
|

Re: daily.output and ROOTBACKUP

Peter Bisroev-2
Hi Guys,

That is what I suspected.

I can obviously patch the scripts up for now, but long term, should we have a
VERBOSESTATUS equivalent flag to complement ROOTBACKUP?

--peter

On Mon, Feb 4, 2013 at 3:57 PM, Alexander Hall <[hidden email]> wrote:

>
>
> "Wesley M.A." <[hidden email]> wrote:
>
>>Hi
>>
>>'man 5 crontab' give :
>>Command output is mailed to the crontab owner
>
> True but irrelevant here. The daily cronjob and friends shouldn't pass anything on stdout or stderr, but mails it themselves.
>
> On the subject, I dont think there is a simple way to quiet it apart from editing the scripts.
>
> /Alexander
>
>>It is why you have root emails...(root backups are provided from
>>security scripts (from daily))
>>
>>Cheers,
>>
>>Wesley
>>
>>Le 2013-02-04 20:03, Peter Bisroev a écrit :
>>> Hi All,
>>>
>>> This is a very minor issue, and I could possibly have missed
>>> something in the
>>> documentation since I do not see people asking this question on the
>>> mailing
>>> lists. So if someone could point me in the right direction it would
>>> be really
>>> appreciated.
>>>
>>> I am using OpenBSD 5.2 on a number of hosts, and all works great. I
>>> have
>>> daily.local setup as follows:
>>>
>>> --------------------------------------------------
>>> cat /etc/daily.local
>>> ROOTBACKUP=1
>>> VERBOSESTATUS=0
>>> --------------------------------------------------
>>>
>>> Normal daily output is not emailed, however because I do have
>>> ROOTBACKUP=1 I
>>> get daily emails about root backups as shown below:
>>>
>>> --------------------------------------------------
>>> OpenBSD 5.2 (GENERIC.MP) #368: Wed Aug  1 10:04:49 MDT 2012
>>>
>>> [hidden email]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
>>>
>>>  1:31AM  up 24 days,  1:40, 0 users, load averages: 0.78, 0.28, 0.15
>>>
>>> Backing up root=/dev/rwd0a to /dev/rwd0d:
>>> 131527+0 records in
>>> 131527+0 records out
>>> 1077469184 bytes transferred in 57.954 secs (18591693 bytes/sec)
>>> ** /dev/rwd0d
>>> ** Last Mounted on /
>>> ** Phase 1 - Check Blocks and Sizes
>>> ** Phase 2 - Check Pathnames
>>> ** Phase 3 - Check Connectivity
>>> ** Phase 4 - Check Reference Counts
>>> ** Phase 5 - Check Cyl groups
>>> 1756 files, 26205 used, 490058 free (50 frags, 61251 blocks, 0.0%
>>> fragmentation)
>>>
>>> MARK FILE SYSTEM CLEAN? yes
>>>
>>>
>>> ***** FILE SYSTEM WAS MODIFIED *****
>>> --------------------------------------------------
>>>
>>> The reason that I am getting this output makes sense, since the daily
>>
>>> manpage
>>> states:
>>>
>>> --------------------------------------------------
>>> If set to 0, df(1), dump(8), netstat(1), and ruptime(1)
>>> are skipped.  Consequently, if none of the other
>>> commands produce any output, no mail will be sent to
>>> root.
>>> --------------------------------------------------
>>>
>>> So what would be the correct way to instruct the rootbackup process
>>> not to
>>> produce output unless something is wrong?
>>>
>>> Thank you!
>>> --peter

Reply | Threaded
Open this post in threaded view
|

Re: daily.output and ROOTBACKUP

Alexander Hall
On 02/04/13 22:09, Peter Bisroev wrote:
> Hi Guys,
>
> That is what I suspected.
>
> I can obviously patch the scripts up for now, but long term, should we have a
> VERBOSESTATUS equivalent flag to complement ROOTBACKUP?

Not sure. As VERBOSESTATUS already has it's special meaning, I'm
thinking along the lines of a more generic QUIET variable,
accompanied with sth like what's below, parts of which might be
considered overkill. Maybe it is all overkill.

- - - - - - -

QUIET=false

do_part() {
        local _err;
        "$@" && return
        _err=$?
        QUIET=false
        return $_err;

        # Or simpler but less fine-grained:

        "$@" || ! QUIET=false
}

...

run_script "daily.local" # override QUIET at will

[ true != "$QUIET" ] || QUIET=false

...

start_part checking foo
do_part echo "doing bar"
do_part cat /nonexistant # disables QUIET operation

...

if ! $QUIET && [ -s $MAINOUT ]; then
        mail -s "`hostname` daily insecurity output" root < $MAINOUT
fi

- - - - - - -

/Alexander