Solved

scripting cron jobs on a Red Hat box

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
What is linux 4.8.22? Is it the same as ubuntu 16.10 ?? 2 71
linux SFTP 8 76
Check for Linux process in script 7 65
rolling back version of firefox 1 29
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,…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

740 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