scheduling tasks with cron


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers scheduling tasks with cron
# 1  
Old 03-20-2007
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  
Old 03-20-2007
Code:
echo "contents" | mail -s "subject" address

# 3  
Old 03-20-2007
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  
Old 03-21-2007
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 Smilie
# 5  
Old 03-21-2007
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 Smilie
Matrix - thanks a lot, it did work. See now i'm a cron expert :-)
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Scheduling cron job

Hi Everybody, I want to run a script at every 5 seconds. I know how to run it every 5 minutes, is there any possibility to run a script at 5 seconds interval. Regards, Mastan (3 Replies)
Discussion started by: mastansaheb
3 Replies

2. UNIX for Dummies Questions & Answers

Cron confusion - scheduling a script

I have a script that backs up a directory, creates a log file and mails the log file to us. find . -print | backup -ivqf/dev/rmt0 | tee backup.log cat backup.log|mail -v -s "Tape backup log" maillist This script works fine from the console. When I schedule it in cron, I never get the... (1 Reply)
Discussion started by: landog
1 Replies

3. Ubuntu

cron-tab issue(Task scheduling)

I used the cron-tab to run the rails's server 24 hours for my application by issuing the following command in terminal crontab -3(To open the cron-tab terminal) and then * * * * * OSV/OpenStreetView/script/server Similarly i tried to run server for the django application by issuing the... (2 Replies)
Discussion started by: amritpalpathak
2 Replies

4. Shell Programming and Scripting

Cron Job Scheduling

Hi All, I have a script which is scheduled in the Cron. It runs every 10th and 40th min of an hour.The job has to run every 30min. But, I do not want to have the 00:10 MST run every day.Is it possible to exclude that run from the schedule?Or any other way through which i can run my job every... (4 Replies)
Discussion started by: sparks
4 Replies

5. UNIX for Dummies Questions & Answers

Scheduling tasks with cron in Slackware 12

How do I start, restart and stop the cron service under Slackware 12? (1 Reply)
Discussion started by: proactiveaditya
1 Replies

6. Shell Programming and Scripting

Scheduling Cron job-Problem

Hello All, I want to run a script for every 5 minutes interval.So i developed a script which has to be scheduled to run for every 5 minutes. That script internally runs another script. But the problem is it is not executing properly. Can anybody throw some light on this. Below are the code... (4 Replies)
Discussion started by: RSC1985
4 Replies

7. UNIX for Advanced & Expert Users

Scheduling bi-weekly through cron

Is there a way in AIX to schedule a script to run bi-weekly through cron? I have a script that needs to run every other Wednesday, and this is what I thought I had to enter in the crontab file: 00 08 * * 3/2 /home/user/user.script It didn't like that. It reports a syntax error. I'm almost... (5 Replies)
Discussion started by: LPT
5 Replies

8. UNIX for Dummies Questions & Answers

Understanding cron scheduling command

Below are two cron entries. what is the difference beteeen writing 20 and */20? how is "20 * * * *" different from "*/20 * * * *"? 1) 20 * * * * find /tmp/ -name "*.log.*" ! -name "*.gz" -mmin +1440 -exec gzip '{}' \; 2) */20 * * * * find /tmp/ -name "*.tmp.*" ! -name "*.gz" -mmin +1440... (6 Replies)
Discussion started by: niks
6 Replies

9. HP-UX

cron scheduling?

Hi all, i want a job to run first monday of every of month. (1 Reply)
Discussion started by: megh
1 Replies

10. UNIX for Advanced & Expert Users

cron job scheduling

Hi, How can I configure cron file , to execute a script on evey alternate saturdays ? I am using AIX 5.0 machine Thanks in advance Shihab (1 Reply)
Discussion started by: shihabvk
1 Replies
Login or Register to Ask a Question