Re: Create log file from script code..



On Thu, 30 Mar 2006 23:10:39 +0200, Geir Holmavatn wrote:
Hi,

Complete newbie here :-|

I have managed to create a few scripts which are started from crontab.
However I would like a verification that they actually have been executed.

How do I include in my bash script code to append a line like "MyScript was
run at <current date / time>" to the text file 'cronjobs.log' (and that
cronjobs.log is created if it doesn't exist)...

Sorry if this is too much to ask, but I learn a lot from examples

lots of code examples in /etc/init.d

echo "MyScript started $(date) " >> /tmp/cronjobs.log

For extra points, read
! bash script introduction documentation
http://tldp.org/LDP/intro-linux/html/index.html

! bash script advanced documentation
http://tldp.org/LDP/abs/html/index.html
.



Relevant Pages