View Full Version : Another crontab question
techassist
8-15-02, 11:35 AM
Hello I was wondering if anyone knew of a unix command that I could use with crontab to email a textfile from my server to me on a regular basis. I know how to set up cron but do not know how or if I could do this with sendmail or not. Thanks for any info on the subject. Jay
kitykity
8-15-02, 11:44 AM
I'm copying this from a file I already have... of course you will need to set up the time/date options at the front of the line for cron...
/usr/bin/mailx -s "subject" fred@blah.net < thisfile.eml
that's how I run it on my Sun box to send me a file... might work for you...
techassist
8-15-02, 12:05 PM
Kity thank you for the reply, I really need to learn how to do this correctly.
So I would use (fred@blah.net) as where to put the email address I want it sent to and (< thisfile.eml) as the path to the file I would like sent? Such as (< html-docs/log.txt ).
/usr/bin/mailx -s "subject" fred@blah.net < thisfile.eml
kitykity
8-15-02, 12:08 PM
Test it, I think that will work for you. In the crontab don't forget to put your time/date information at the beginning of the line.
techassist
8-15-02, 12:13 PM
I will give it a try and set it up and post the results tomorrow. And I also appreciate your assistance with this :)
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.