<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
Well, what does it do? So you can see from the logs that cron
executes the file, but doesn't appear to do anything?<br>
<br>
My cron sends me an email on each execution (if there is any output
from the script).<br>
Put more 'echo' commands in to troubleshoot, so that something
prints to STDOUT | ERR whenever run.<br>
If there's a problem (like it can't find the ping command or your
backup script) it should at least tell you that. <br>
<br>
Script should probably have the full path name for the
ping_check.txt file, so you know where to look for it. (ie.
/tmp/ping_check.txt). Make sure cron has permission to write the
file.<br>
<br>
If there is a problem with cron not finding the path's to
executables, put a PATH in the crontab.<br>
<br>
=========== crontab
============================================================<br>
PATH=/root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin<br>
<br>
# m h dom mon dow command<br>
<br>
*/5 * * * * /usr/local/bin/ping.sh >2&1 (.. or
> /dev/null 2>&1 later to get rid of the annoying emails)<br>
=============================================================================<br>
<br>
<br>
<br>
On 01/04/2011 04:07 PM, Raymond Norton wrote:
<blockquote cite="mid:4D239A36.6070904@lctn.org" type="cite">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
How should this script be run from cron? I tried appending >
/dev/null, but can't get it to run like it does from the command
line.<br>
<br>
<br>
<br>
<br>
On 01/04/2011 09:14 AM, Raymond Norton wrote:
<blockquote cite="mid:4D23394B.60306@lctn.org" type="cite">
<meta content="text/html; charset=UTF-8"
http-equiv="Content-Type">
Took a couple hours of pounding away, but yeah, the script works
perfectly with my backup solution!<br>
<br>
<br>
Thanks<br>
<br>
<br>
<br>
<br>
<br>
<br>
On 01/03/2011 03:56 PM, John Hawley wrote:
<blockquote cite="mid:4D224618.1020809@hissingdragon.net"
type="cite">
<meta content="text/html; charset=UTF-8"
http-equiv="Content-Type">
<title></title>
#!/bin/bash<br>
<br>
HOST="windowshostname"<br>
<br>
CMD="ping -c1 $HOST"<br>
CMD_RET=`$CMD`<br>
# echo $CMD_RET<br>
NOWDATE=`date +%Y%m%d`<br>
<br>
if [ -f ping_check.txt ];<br>
then<br>
FILEDATE=`cat ping_check.txt`<br>
else<br>
FILEDATE=0<br>
fi<br>
<br>
if [ $NOWDATE -ne $FILEDATE ];<br>
then<br>
if [[ $CMD_RET =~ ", 0% packet loss" ]]<br>
then<br>
echo "$HOST pinged ..."<br>
echo $NOWDATE > ping_check.txt<br>
# run backup script<br>
else<br>
echo "$HOST did not ping ..."<br>
fi<br>
fi<br>
<br>
exit<br>
<br>
<br>
<br>
On 01/03/2011 03:04 PM, Raymond Norton wrote:
<blockquote
cite="mid:25760621.01294088660382.JavaMail.root@mail.lctn.org"
type="cite">
<style type="text/css">p { margin: 0; }</style>
<style type="text/css">body { font-family: 'Times New Roman'; font-size: 12pt; color: #000000}</style>Yes,
it
will
have
the same address . I would prefer to run it from the
backup server, but am open to anything that is simple.<br>
<br>
<br>
----- "Justin Krejci" <jus@krytosvirus.com> wrote: <br>
> Does the windows XP machine always have the same IP
address or at
least on the same subnet as the backup server when it is
online?<br>
> <br>
> Can you possibly have the Windows XP host run a
script
automatically when it is online that will trigger the
backup process?<br>
> <br>
> -----Original Message-----<br>
> <b>From</b>: Raymond Norton <<a
moz-do-not-send="true"
href="mailto:Raymond%20Norton%20%3cadmin@lctn.org%3e"
target="_blank">admin@lctn.org</a>><br>
> <b>Reply-to</b>: TCLUG Mailing List <a
moz-do-not-send="true" class="moz-txt-link-rfc2396E"
href="mailto:tclug-list@mn-linux.org"><tclug-list@mn-linux.org></a><br>
> <b>To</b>: <a moz-do-not-send="true"
href="mailto:tclug-list@mn-linux.org" target="_blank">tclug-list@mn-linux.org</a><br>
> <b>Subject</b>: [tclug-list] script help<br>
> <b>Date</b>: Mon, 03 Jan 2011 14:21:21 -0600<br>
> <b>Mailer</b>: Mozilla/5.0 (X11; U; Linux i686;
en-US;
rv:1.9.1.9) Gecko/20100423 Thunderbird/3.0.4<br>
> <br>
>
<pre>I need to come up with a shell script that will launch another script
when a specific host is detected on the network. This is for an network
backup system. The host is always off-line when the back up runs at the
night and I want to fire the backup off when it comes back on-line.
The script would run on the backup server as a cron job, and needs to
call the backup script only once per day.
The backup server is Linux. The host is Windows XP.
_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
<a moz-do-not-send="true" href="mailto:tclug-list@mn-linux.org" target="_blank">tclug-list@mn-linux.org</a>
<a moz-do-not-send="true" href="http://mailman.mn-linux.org/mailman/listinfo/tclug-list" target="_blank">http://mailman.mn-linux.org/mailman/listinfo/tclug-list</a>
</pre>
<br>
> -- <br>
> This message has been scanned for viruses and <br>
> dangerous content by <a moz-do-not-send="true"
href="http://www.mailscanner.info/" target="_blank"><b>MailScanner</b></a>,
and
is <br>
> believed to be clean. <br>
> _______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota <a
moz-do-not-send="true" class="moz-txt-link-abbreviated"
href="mailto:tclug-list@mn-linux.org">tclug-list@mn-linux.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://mailman.mn-linux.org/mailman/listinfo/tclug-list">http://mailman.mn-linux.org/mailman/listinfo/tclug-list</a>
<br>
<br>
-- <br>
Raymond Norton<br>
LCTN<br>
Ecclesiastes 7:21-22<br>
<br>
</jus@krytosvirus.com>
<pre wrap=""><fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:tclug-list@mn-linux.org">tclug-list@mn-linux.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://mailman.mn-linux.org/mailman/listinfo/tclug-list">http://mailman.mn-linux.org/mailman/listinfo/tclug-list</a>
</pre>
</blockquote>
<br>
-- <br>
This message has been scanned for viruses and <br>
dangerous content by <a moz-do-not-send="true"
href="http://www.mailscanner.info/"><b>MailScanner</b></a>,
and is <br>
believed to be clean.
<pre wrap=""><fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:tclug-list@mn-linux.org">tclug-list@mn-linux.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://mailman.mn-linux.org/mailman/listinfo/tclug-list">http://mailman.mn-linux.org/mailman/listinfo/tclug-list</a>
</pre>
</blockquote>
<br>
-- <br>
This message has been scanned for viruses and <br>
dangerous content by <a moz-do-not-send="true"
href="http://www.mailscanner.info/"><b>MailScanner</b></a>,
and is <br>
believed to be clean.
<pre wrap=""><fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:tclug-list@mn-linux.org">tclug-list@mn-linux.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://mailman.mn-linux.org/mailman/listinfo/tclug-list">http://mailman.mn-linux.org/mailman/listinfo/tclug-list</a>
</pre>
</blockquote>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
<a class="moz-txt-link-abbreviated" href="mailto:tclug-list@mn-linux.org">tclug-list@mn-linux.org</a>
<a class="moz-txt-link-freetext" href="http://mailman.mn-linux.org/mailman/listinfo/tclug-list">http://mailman.mn-linux.org/mailman/listinfo/tclug-list</a>
</pre>
</blockquote>
</body>
</html>