[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

UNIX/Linux - CRON Question..

Posted on 2014-04-22
3
Medium Priority
?
764 Views
Last Modified: 2014-04-22
If I want to run a script oracheck.sh every 10 minutes I can edit my crontab using "crontab -r"
0,10,20,30,40,50 * * * * /opt/oracle/bin/oracheck.sh

But can I create a file in /etc/cron.d called oracheck and have this
# cat /etc/cron.d/oracheck

Does the file in cron.d work the same way ...??? if not how can this be interpreted in /etc/cron.d ..???

Thanks..
0
Comment
Question by:prav83
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 1200 total points
ID: 40015910
The content of the files under /etc/cron.d must adhere to the system crontab syntax (/etc/crontab) which means that the 6th column must contain a username under whose credentials the command should be executed. Columns 1-5  are of the same format as in any user crontab.

In fact, the files under /etc/cron.d are treated as extensions of /etc/crontab.

You must be root to edit/create such a crontab file.

0,10,20,30,40,50 * * * * oracleuser /opt/oracle/bin/oracheck.sh
0
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 40015915
On your first remark: crontab -r removes your crontab entry, with crontab -e you edit your crontab file. As which user do you want the script to run?
0
 
LVL 30

Assisted Solution

by:serialband
serialband earned 800 total points
ID: 40015920
If you put it in /etc/ there's an extra entry for the user to run it as
*/10 * * * * oracle /opt/oracle/bin/oracheck.sh

Depending on your linux distro, you could have one or more of the following.
 /etc/cron.d ---> used by packages
 /etc/cron.daily
 /etc/cron.hourly
 /etc/cron.monththy
 /etc/crontab

 /var/spool/cron/crontabs ---> user crontab
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question