Solved

How to create a simple cron in unix

Posted on 2015-01-05
4
232 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
Comment Utility
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
Comment Utility
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
Comment Utility
thank you!
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
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.

744 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

18 Experts available now in Live!

Get 1:1 Help Now