From: YoYo Siska <yoyo@gl.ksp.sk>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] irritating cron habit : solved
Date: Mon, 21 Feb 2011 11:23:43 +0100 [thread overview]
Message-ID: <20110221102343.GB24111@ksp.sk> (raw)
In-Reply-To: <20110221053943.GA3751@ca.inter.net>
On Mon, Feb 21, 2011 at 12:39:43AM -0500, Philip Webb wrote:
> 110220 Philip Webb wrote:
> > 110220 Florian Philipp wrote:
> >> Just change your cron job to look like
> >> 'test -e /var/run/dhcpcd.pid && fetchmail'
> > That's by far the simplest & it still fetches the mail,
> > so we'll see if it also avoids the occasional internal spam msgs.
>
> Indeed it does: I tried delaying starting the I/net connection
> & there is no 'dead.letter' file. Thanks again.
>
> PS the file is /var/run/dhcpcd-eth0.pid , not as above.
btw, if I need to check if the network is up in a script, I usually do
ping -q -c1 -w4 some.remote.host >/dev/null 2>&1 && command-to-run-if-remote-host-reachable
It the advantage that it checks directly connection to the host
you wish to connect to, so it also won't run the command if your network
is up, but the remote host is inaccessible...
If your server doesn't respond to pings, just use some other server
(eg google's public dns 8.8.8.8)
The -w4 paramater controls how long to wait for reply if the network is
up, but the reply is not comming (ie a network problem, if your network
connect is down, ping will return immediately with a "network
unreachable" or "unknown host" error)
yoyo
next prev parent reply other threads:[~2011-02-21 10:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-20 14:04 [gentoo-user] irritating cron habit Philip Webb
2011-02-20 15:27 ` Florian Philipp
2011-02-20 18:18 ` Philip Webb
2011-02-21 5:39 ` [gentoo-user] irritating cron habit : solved Philip Webb
2011-02-21 10:23 ` YoYo Siska [this message]
2011-02-21 11:32 ` Adam Carter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110221102343.GB24111@ksp.sk \
--to=yoyo@gl.ksp.sk \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox