Ausgabe in Datei leiten

FreeBSD, Gentoo, openSUSE, CentOS, Ubuntu, Debian
silent85
Posts: 117
Joined: 2006-10-22 16:02
 

Ausgabe in Datei leiten

Post by silent85 »

Hallo ich möchte gerne die Ausgabe eines Befehls in eine Datei leiten der per Cron ausgeführt werden soll.

Code: Select all

/usr/bin/uptime > /home/load.log
Die Datei load.log wird erstellt und hat richtigen Inhalt.
Nun hab ich aber das Problem das die Datei bei erneuten ausführen aktualisiert wird und nicht wie ich es gerne möchte fortgeschrieben wird.

Gibt es außerdem ne Möglichkeit das datum mit in diese Datei einzufügen sodass ich auch wenn welches Datum zu welchem Eintrag gehört?

Gruss
User avatar
Joe User
Project Manager
Project Manager
Posts: 11190
Joined: 2003-02-27 01:00
Location: Hamburg
 

Re: Ausgabe in Datei leiten

Post by Joe User »

Code: Select all

echo >> /home/load.log
date >> /home/load.log
/usr/bin/uptime >> /home/load.log
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
silent85
Posts: 117
Joined: 2006-10-22 16:02
 

Re: Ausgabe in Datei leiten

Post by silent85 »

Dankeschön das ist genau das was ich gesucht hab.