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
Solved

How to create a simple cron in unix

Posted on 2015-01-05
4
239 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
4 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

837 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