Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8158367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:34:40+00:00 2026-06-06T17:34:40+00:00

we have a developer who setup a crondoc.txt file that is handling our cron

  • 0

we have a developer who setup a crondoc.txt file that is handling our cron jobs and I am not experienced in cron jobs to know how to understand fully how to change this. I have to do this right away so I am looking for some help. I need to change this so that it emails me and send the cron job to a file.

0,20,40 8,9,10,11,12,13,14,15,16,17,18,19,20 * * 1,2,3,5,6,7 /usr/bin/php /home/folder/filename.php >> /dev/null 2>&1

UPDATE: This is actually what does not make sense to me. There is one crontab above and then there is another setup like this below:

0 2 * * 5 /usr/bin/php /home/folder/filename.php | mail -s "Service Alert Output" me@myemail.com

Question: How do I combine them so I can get the email and also log to a file?

I don’t know what the ending means after the file name starting at >> but would like this to email me and put into a log file. Possible? Example would be great to help me get this accomplished.

Thank you.

Rob

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T17:34:42+00:00Added an answer on June 6, 2026 at 5:34 pm

    To change email settings, you should use MAILTO variable, for example put

    MAILTO=vivek@nixcraft.in

    at the beginning of cron file. You can read more about MAILTO variable here – http://www.cyberciti.biz/faq/linux-unix-crontab-change-mailto-settings/

    With regards to >> /dev/null 2>&1 part, it redirects output of the command to /dev/null file. So you should change /dev/null to the filename where you want to save output of the command.

    EDIT:

    Example of full crontab file:

    MAILTO=youremail@example.com
    0 2 * * 5 /usr/bin/php /home/folder/filename.php >> /path/to/your/logfile 2>&1
    

    I think you don’t need to pipe output of the command to mail program because crontab has builtin feature for it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a flash developer who uses calls a file called proxy.php with the
I am building a Rails application that contains Developer s who have Application s.
So I am web developer who used to have a kind graphics design person
I have inherited a few programs from a previous developer who was a little
I have been given the unenviable task of cleaning up after a developer who
I work with a front-end developer who writes JSP files. We have a form
I have a client who has brought in another developer to work on a
I'm a developer who uses RoR-CoffeeScript-Sass-Passenger-Apache. We use EC2 for our deployment and we
We have a partner that is actually owning our app on it's iTunes Connect
my current setup is as follows: We have a Linux samba share that contains

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.