Solved

scripting cron jobs on a Red Hat box

Posted on 2013-12-02
3
401 Views
Last Modified: 2014-01-02
Hi,
It has been a few years since I scripted a Cron job, now I need to do it in Linux.

Anyone have good links for this?  

I need to known
1. Where to place the file
2. How to place it in the Cron scheduler

Thanks.
0
Comment
Question by:NYGiantsFan
[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 25

Assisted Solution

by:SStory
SStory earned 167 total points
ID: 39690305
It depends upon if it i will be ran by root, local user or what. You could actually place it anywhere depending upon what it does.

2.
crontab -e

create the entry
ESC
:
qw
to save

#---------------- Minute (0 - 59)
  |  #------------- Hour (0 - 23)
  |  |  #---------- Day of the Month (1 - 31)
  |  |  |  #------- Month (1 - 12)
  |  |  |  |  #---- Day of the Week (0 - 6) (Sunday=0 or 7)
  |  |  |  |  |
  *  *  *  *  *  example-script.sh
(source: http://community.linuxmint.com/tutorial/view/1072)
0
 
LVL 34

Assisted Solution

by:Duncan Roe
Duncan Roe earned 166 total points
ID: 39691021
You need to log in as the user under which you want the job to run. Then use crontab -e to insert the job, crontab -l to check it inserted OK.
0
 
LVL 16

Accepted Solution

by:
Joseph Gan earned 167 total points
ID: 39693841
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

707 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