Solved

scripting cron jobs on a Red Hat box

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
Fine Tune your automatic Updates for Ubuntu / Debian
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

777 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