Created
December 14, 2011 11:29
-
-
Save PythonicNinja/1476216 to your computer and use it in GitHub Desktop.
Skrypt wysyłania na maila historii komend
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# SKRYPT WYSYLANIA HISTORII KOMEND | |
DATA=$(date) | |
# ADRES DO WYSLANIA | |
EMAIL="[email protected]" | |
# TRESC MAILA | |
TRESC="Historia" | |
echo "To jest historia Twoich komend z $HOSTNAME z dnia:"> $TRESC | |
date >>$TRESC | |
echo "Ilosc komend to:">>$TRESC | |
history | wc -l >>$TRESC | |
echo "Tresc komend to:">>$TRESC | |
history >>$TRESC | |
history > hist.txt | |
# WYSLANIE WIADOMOSCI | |
mail -s "Komendy $HOSTNAME z $DATA" -a hist.txt "$EMAIL" < $TRESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment