LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Problem with using vixie cron (https://www.linuxquestions.org/questions/linux-newbie-8/problem-with-using-vixie-cron-340349/)

sendas4 07-05-2005 05:08 PM

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

kencaz 07-05-2005 05:19 PM

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

sendas4 07-05-2005 05:38 PM

Worked. Cool thanks


All times are GMT -5. The time now is 11:44 PM.