[Gllug] adding to a text file using crontab
Sharon Kimble
sharonm63 at tiscali.co.uk
Fri Sep 3 10:43:37 UTC 2004
Can I ask your advice please?
In my root crontab I have this line '*/5 * * * * DATE=`date` UPTIME=`uptime` ;
echo "$DATE $UPTIME" >/opt/logwatch/uptime.txt' [which is one continuous line
although it wraps here] but in uptime.txt it only shows one line of text
which is constantly being updated. How can I get it so that it is just adding
to the bottom of the text file instead of replacing please?
If I can get it to add, then it can show when the system goes down, perhaps
because of a power cut, whereas, at present, it is just overwritten.
Sharon.
--
11:38:11 up 1 day, 15:26, 1 user, load average: 1.20, 1.17, 1.23
Linux is like a wigwam, no windows, no gates, apache inside.
Fedora Core 2, KDE 3.3.0, OpenOffice 1.1.2
Registered Linux user 334501
--
Gllug mailing list - Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug
More information about the GLLUG
mailing list