?
Solved

How to create a simple cron in unix

Posted on 2015-01-05
4
Medium Priority
?
255 Views
Last Modified: 2015-01-05
I need to create a very simple cronjob in unix to be launched at certain time, lets say 22:30, it will need simply to launch a simple script with the command date to be written on a file, just that.


The crons in my system right now are these, in this location:

crontab -l
00 02 * * * $HOME/folder1/script1.ksh >/dev/null
00 15,30,45 * * * * $HOME/folder1/script2.ksh >/dev/null
00 02 * * * $HOME/folder1/script3.ksh > $HOME/menu/log/mylog.log
0
Comment
Question by:celtician
[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
4 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 2000 total points
ID: 40532270
30 22 * * * date > /path/to/file

Use "crontab -e" to open the crontab with an editor. Add the above line and save the crontab.

Replace "/path/to/file" with a valid path and name of your choice. Use ">>" instead of ">" to append to the file instead of overwriting it.
0
 
LVL 18

Expert Comment

by:sventhan
ID: 40532300
you need to add this entry on your crontab

by typing at the prompt

crontab -e

then add this...

30 22 * * * /path/to/the/script

path to the script is your executable.
0
 

Author Closing Comment

by:celtician
ID: 40532449
thank you!
0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
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.:
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

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