Solved

Cron Job

Posted on 2002-07-25
6
288 Views
Last Modified: 2010-04-21
How can I write cronjob that executes a command and sends the output to another file.  Then I would like to schedule a job to run at 7:00 everyday.  Where can I find material to learn about cronjobs.
0
Comment
Question by:UnixKid
6 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 7178996
man 5 crontab
0
 
LVL 38

Accepted Solution

by:
yuzh earned 50 total points
ID: 7179077
edit your crontab to add a cron task like the followings:

0 7 * * * /full-path-to/yourcommand > /tmp/outfile 2>&1


eg, if you want to run "find", use /usr/bin/find, and the outfile must be the full path to outfile.

if you are not running it as the super user "root", then you need to ask your sys adm to set up let you run cron job.

do a
man crontab

find out more details


0
 
LVL 1

Expert Comment

by:m4rc
ID: 7203620
i always put this as a comment on the top of my crontab,
as a reminder

#minute hour    mday    month   wday    command

and then add a comment before each entry so its easier to
understand the intention of the entry.

# at 7am every day run yourcommand and save the output to
# outfile
0 7 * * * /full-path-to/yourcommand > /tmp/outfile 2>&1
0
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.

 

Expert Comment

by:RudePuppyDog
ID: 7243628
0
 
LVL 20

Expert Comment

by:tfewster
ID: 7921702
No comment has been added lately, so it's time to clean up this Topic Area.
I will leave a recommendation for this question in the Cleanup topic area as follows:

- Answered by yuzh

Please leave any comments here within the next 7 days

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

tfewster
Cleanup Volunteer
0
 

Expert Comment

by:SpideyMod
ID: 7967266
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
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…
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.:

708 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

15 Experts available now in Live!

Get 1:1 Help Now