Solved

scripting cron jobs on a Red Hat box

Posted on 2013-12-02
3
357 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
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
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.

758 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now