Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
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.
I only intended to run this script one time, but it runs every Tuesday for some reason. I have other machines with similarly narrowed down schedules and they work as expected.
I'm redirecting output to /dev/null to not receive an email. I know I can also use the MAILTO="" directive, but I'm pretty sure I've successfully used this method in the past.
there are a few problems:
you need to write redirection as:
03 20 08 05 2 root /root/script1.sh >/dev/null 2>&1 (this will redirect stderr to stdout and than stdout to /dev/null) otherwise you will redirect stdout to /dev/null and stderr to stdout.
The number 2 before root (fifth field) means you want to execute it on every Tuesday (see man page of crontab)
Your claims of other machines working as expected notwithstanding, the manpage for the crontab file (`man 5 crontab`) quite clearly states:
Quote:
Note: The day of a command’s execution can be specified by two fields — day of month, and day of week. If both fields are restricted (ie, aren’t *), the command will be run when either field matches the current time. For example, "30 4 1,15 * 5" would cause a command to be run at 4:30 am on the 1st and 15th of each month, plus every Friday.
Thank you gentlemen. Upon further examination, I do see that the other jobs I referenced as working as expected, were in fact running every week, I just didn't realize it because there was nothing for them to do during that time frame. This was a good lesson, my understanding of the crontab table format was incorrect, I thought all restricted (non *) fields had to match.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.