Share your knowledge at the LQ Wiki.
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, 11:36 AM   #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, 12:41 PM   #2
Registered: May 2005
Distribution: aptosid
Posts: 55

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

Old 01-11-2010, 12: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, 06:25 PM   #4
Senior Member
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, Ubuntu 14.04 LTS, Ubuntu 12.04 and recently Ubuntu Mate 15,04
Posts: 1,268

Rep: Reputation: 100Reputation: 100
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 06: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 03:09 AM
adding a perl script to cron.daily / cron.d to setup a cron job CrontabNewBIE Linux - Software 6 01-14-2008 08:16 AM
Cron Job: Start it Only once on specified time jCash Linux - Newbie 2 12-07-2007 07:35 PM
Cron job files by date Kumado Linux - General 4 04-26-2006 05:02 PM
Start Date + Time Duration = End Date/Time calculator? ToBe Linux - General 3 09-26-2005 10:17 AM

All times are GMT -5. The time now is 04:57 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration