The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
performing a task at regular intervals mridula High Level Programming 2 11-14-2005 05:26 AM
Date Intervals yongho Shell Programming and Scripting 7 07-29-2005 04:19 PM
How to perform Date Intervals? yongho Shell Programming and Scripting 2 06-21-2005 11:02 AM
Mailing an attachment gayath3 UNIX for Dummies Questions & Answers 4 03-21-2005 01:02 AM
Schedule a Batch file to delete files at particular intervals Indom Windows & DOS: Issues & Discussions 6 02-04-2004 12:57 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-19-2005
timepassman timepassman is offline
Registered User
  
 

Join Date: Aug 2005
Posts: 3
Unhappy mailing myself at regular intervals...

hi all,
i wrote a script to mail myself using pine (modified) to keep remind of b'days.
#!/bin/bash
grep "`date +%D |awk -F/ '{print $2+1, $1+0}'`" dataFile >/home/username/mailme

if test -s /home/username/mailme
then
pine -I '^X,y' -subject "Birthday Remainder" username </home/username/mailme
fi
--
dataFile is of format:
6 12 Myla i.e day month name
---
now, when i try run it thru crontab at regular interval it doesn't run.
i can run the script thru commandline and it works. but thru cron, it doesn't what should i do?
---
also is there any other way to mail oneself in scripts?
(using fedora core 4 and our mail server doesn't require authentication)
thanx alot for help....

Last edited by timepassman; 08-19-2005 at 12:52 PM..
  #2 (permalink)  
Old 08-19-2005
reborg's Avatar
reborg reborg is offline Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,209
The reason for you ploblem is that cron has a minimal environment, most likely it is not finding pine. There are other ways to do what you want. See this forum
  #3 (permalink)  
Old 08-19-2005
timepassman timepassman is offline
Registered User
  
 

Join Date: Aug 2005
Posts: 3
but we have a mail server and configuring mailx itself will take time. as such i was avoiding it. i don't want to configure sendmail or mailx to interact with our mail server, then be able to use my script.
is there no shortcut?
  #4 (permalink)  
Old 08-19-2005
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,115
On linux mailx is called mail. You are probably using sendmail, if not, what do you use? In your script, replace pine with a full path to pine and it should work.
  #5 (permalink)  
Old 08-21-2005
timepassman timepassman is offline
Registered User
  
 

Join Date: Aug 2005
Posts: 3
Talking got it...

path to file 'dataFile' was missing..
no i m not using mailx/sendmail..i applied a patch to pine so that i could mail by commandline...
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:08 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0