Linux - NewbieThis 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!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Did you put this in *your* crontab, or in /etc/crontab?
From the man page: The format of a cron command is very much the V7 standard, with a number of upward-compatible extensions. Each line has five time and date fields, followed by a user name if this is the system crontab file, followed by a command.
Ah, I used "crontab -e" so that must be the user's cron. With the /etc/crontab option, is there a way I can get only the output of the cron I add emailed to me? In the "crontab -e" way, I specified a MAILTO variable, but I don't want the output of every script in /etc/crontab emailed to me.
As far as I know, MAILTO in /etc/crontab would have the outcome you've mentioned, that you'll get mail for every command it runs.
As repo stated previously, another way to do this is to use the crontab of the user you want to execute the command. So instead of "crontab -e", you could do "sudo -u selenium crontab -e" (assuming you've set yourself up with sudo rights as selenium, or just su to selenium, login as selenium with a new session, etc.). You could set MAILTO=youruid in selenium's crontab, and all is well.
Or, you could still run it out of /etc/crontab, but instead of using mail, write your output to a log file.
We want to periodically run some Selenium regression tests against a Selenium remote control server.
So to the issue of "MAILTO", how would I set that up in /etc/crontab to only email me the results of that job and not others? Upon your response, I'll mark this as resolved and increase your rep . - Dave
This gets you a log file with current time and date stamp, so if you're happy there, you're finished. Otherwise, I would make a second cron job that runs after this one, which checks the given path for a log file with the correct date stamp, and mails it to me.