LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-05-2005, 05:08 PM   #1
sendas4
Member
 
Registered: May 2004
Location: Tacoma, Wa
Distribution: Gentoo
Posts: 94

Rep: Reputation: 15
Problem with using vixie cron


Im trying to make a cron job for the first time. Im using gentoo with vixie cron. I start the cron deamon fine.

I want to send an email every half hour. From what ive read I put the script into the /etc/cron.d direcotry. The script has been tested and is working.

the script is

test.sh

*/30 * * * * root /root/scripts/email.sh



and email.sh has

#!/bin/bash
email -q -s "test subject" myemail@email.com < testlog.txt

After this did not work I read some more and did

crontab -e
*/30 * * * * root /root/scripts/email.sh
 
Old 07-05-2005, 05:19 PM   #2
kencaz
Senior Member
 
Registered: Mar 2005
Location: Las Vegas, NV
Distribution: Mandriva Slackware FreeBSD
Posts: 1,468

Rep: Reputation: 48
rather then have cron run your script... Run "crontab" and add the line itself.

email -q -s "test subject" myemail@email.com < testlog.txt

Anything you can successfully run from CLI you can add to cron just adding the time... Here is a sample of how I send an e-mail to myself everyday at 6:15pm

15 18 * * Mon-Fri cat ~/docs/tips.txt | mail -s "tips" kencaz@linuxmail.org

KC
 
Old 07-05-2005, 05:38 PM   #3
sendas4
Member
 
Registered: May 2004
Location: Tacoma, Wa
Distribution: Gentoo
Posts: 94

Original Poster
Rep: Reputation: 15
Worked. Cool thanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
shell script using /etc/cron.hourly to execute cron.php file? rioguia Programming 3 06-11-2008 08:09 AM
How to Upgrade [ vixie-cron-4.1-2_EL3 ] rpm maxboost Linux - Enterprise 1 03-07-2005 04:40 PM
vixie-cron issues Bigun Linux - Software 1 12-17-2004 09:08 AM
dual entries in cron log for cron.daily cpharvey Linux - General 3 02-27-2003 02:30 PM
Cron/Vixie runs jobrotate 6 hours late SEL Linux - General 0 04-21-2002 04:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration