Solved

Cron Job

Posted on 2002-07-25
6
301 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
[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
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
Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

 
LVL 21

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

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

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…
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
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 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.

688 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