Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-11-2010, 12:36 PM   #1
Registered: Jan 2010
Location: tampa bay fl
Distribution: fedora redhat 9 10 11 12 13 &14 x86_64 & i686; Peppermint, MintOne; RHEL 4 5 6, Ubuntu, SliTaz etc,
Posts: 102

Rep: Reputation: 16
how do i log the start/completion (time&date) of my cron job script?

how do i log the start/completion (time&date) of my cron job script?

i want to be able to see what time it started and what time it finished? and if there where any errors while running my script

Old 01-11-2010, 01:41 PM   #2
Registered: May 2005
Distribution: spiral, fedora
Posts: 65

Rep: Reputation: 18
Try logger. It's made for what you're trying to do.

Old 01-11-2010, 01:46 PM   #3
Senior Member
Registered: Mar 2004
Location: Cary, NC, USA
Distribution: Fedora, Kubuntu, RedHat, CentOS, SuSe
Posts: 1,288

Rep: Reputation: 99
You could also put the "date" command at the top and bottom of your script. Any output from you script should be emailed to the user it is run as. If you want to send it to a different address include a line similar to, "" in your crontab file.


Old 01-11-2010, 07:25 PM   #4
Senior Member
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127

Rep: Reputation: 174Reputation: 174
I have generally written a log file to keep track of the performance of my scripts. For example
echo Starting data mirror >> /quitelarge/_mirror/mirror.log
echo $(date +%y/%m/%d_%r) >> /quitelarge/_mirror/mirror.log
I also write and entry to the log when major milestones in the process complete - same syntax.

Hope this helps.


p.s. these lines are included in the shell script which would be executed by cron.

Last edited by taylorkh; 01-11-2010 at 07:25 PM. Reason: a little more info


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
log errors in cron job timl Red Hat 2 10-02-2009 04:09 AM
adding a perl script to cron.daily / cron.d to setup a cron job CrontabNewBIE Linux - Software 6 01-14-2008 09:16 AM
Cron Job: Start it Only once on specified time jCash Linux - Newbie 2 12-07-2007 08:35 PM
Cron job files by date Kumado Linux - General 4 04-26-2006 06:02 PM
Start Date + Time Duration = End Date/Time calculator? ToBe Linux - General 3 09-26-2005 11:17 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:55 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration