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 > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Scheduling bi-weekly through cron LPT UNIX for Advanced & Expert Users 5 02-20-2009 11:45 AM
Passing arguments to a shell script from file while scheduling in cron weblogicsupport SUN Solaris 4 01-27-2008 11:16 PM
Problem with scheduling a shell script on cygwin using cron shash UNIX for Dummies Questions & Answers 4 08-09-2007 06:08 PM
Need help with tasks! RomeO UNIX for Dummies Questions & Answers 1 11-23-2005 06:03 PM
cron job scheduling shihabvk UNIX for Advanced & Expert Users 1 08-22-2005 10:36 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-20-2007
alikun alikun is offline
Registered User
  
 

Join Date: Mar 2007
Posts: 23
scheduling tasks with cron

hello there,

i'm learning about task scheduling with cron and all seems hyper exciting, yeppie. But there is a prob:

assume i have a script that needed to be executed at 7am everyday. I could do:

vi mycron
00 7 * * * echo hi mother, i wanna be a script daddy.
:wq

crontab mycron

how can i have the shell send the results to my neighbor's email address at

unixbuddy@hello.com?.

i added mailto: unixbuddy@hello.com in my script but didnt work.

Thanks all very much,
alikun
  #2 (permalink)  
Old 03-20-2007
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,944
Code:
echo "contents" | mail -s "subject" address
  #3 (permalink)  
Old 03-20-2007
alikun alikun is offline
Registered User
  
 

Join Date: Mar 2007
Posts: 23
Quote:
Originally Posted by matrixmadhan
Code:
echo "contents" | mail -s "subject" address
matrix thanks a lot, that was very kind of you:
i tried it as follows but had an error "message bad minute" in my file after submitting for crontab. This is what i did:

vi mycron
00 7 * * * echo hi mother, i wanna be a script daddy.
echo hello | mail -s hello again unixbuddy@hello.com
:wq

crontab mycron

what does "contents" refer to? should hello again be within quotes?. couldn't find the mistake.

Thanks a lot,
alikun
  #4 (permalink)  
Old 03-21-2007
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,944
it should be of the following form,

Code:
00 7 * * * echo "hi mother, i wanna be a script daddy." | mail -s "hello again" unixbuddy@hello.com
by contents, I meant the message that you are trying it send it via mail.


Posted above should work, paste it and save in the cron file
  #5 (permalink)  
Old 03-21-2007
alikun alikun is offline
Registered User
  
 

Join Date: Mar 2007
Posts: 23
Quote:
Originally Posted by matrixmadhan
it should be of the following form,

Code:
00 7 * * * echo "hi mother, i wanna be a script daddy." | mail -s "hello again" unixbuddy@hello.com
by contents, I meant the message that you are trying it send it via mail.


Posted above should work, paste it and save in the cron file
Matrix - thanks a lot, it did work. See now i'm a cron expert :-)
Sponsored Links
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 08:32 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