BASH scripting help
I am running a DD-WRT enabled Linksys WRT350N router
To say I'm a novice bash/C/UNIX programmer is an overstatement, but I learn as I go I've cobbled together a script that emails me when clients sign on/off my network: Quote:
When I run the script through the command line: Quote:
I know cron requires "absolute" paths (???) and I though I specified that everywhere, but I cant figure out whats going on now cron command i'm using is: Quote:
|
Quote:
|
right now I have it run every five minutes & it does...but the email body is blank
|
Try these alterations:
1. use bash instead of sh 2. use Code:
set -xv 3. provide full path to sendmail cmd 4. Code:
*/5 * * * * root /opt/arpmail.sh >/tmp/arpmail.log 2>&1 |
The -x in sh -x /tmp/custom.sh produces command tracing output, normally sent to the terminal. When run from cron, there is no terminal to send it to. cron normally captures any such output and mails it.
Unexpected that the mail does not send the trace output in the body of the mail. Have you tried sh /tmp/custom.sh ? |
All times are GMT -5. The time now is 05:17 AM. |