![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Ping Problem | ashokmeti | IP Networking | 4 | 02-07-2008 05:42 AM |
| help help cronjob problem with script | bucci | Shell Programming and Scripting | 4 | 02-10-2007 12:38 AM |
| ping problem | vviscomi | UNIX for Dummies Questions & Answers | 1 | 12-22-2004 11:49 AM |
| Problem with cronjob... | kswaraj | Shell Programming and Scripting | 1 | 07-14-2004 11:58 AM |
| Ping problem. system down!! | TRUEST | Shell Programming and Scripting | 3 | 02-21-2003 11:16 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
ping cronjob problem
Hi all,
I'm trying to write a shell script that will ping a site and and write the date and 1 or 0 (for success or no success) to a file. it looks roughly like this: #/bin/sh set mydate = `date` set myvar = `ping -c 1 hostname | grep -c "100%"` if ($myvar == 1) then echo $mydate" 0" >> banneruptime.txt else echo $mydate" 1" >> banneruptime.txt endif It works when I call it from the commandline, but not when i call it from a cronjob. On my MacOS X machine ping resides in /sbin, so I added that to the cronpath. But I get a "syntax error: unexpected end of file" error. Any ideas? Thanks. |
| Forum Sponsor | ||
|
|
| Thread Tools | |
| Display Modes | |
|
|