Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Skrypt wysyłania na maila historii komend
#!/bin/bash
# SKRYPT WYSYLANIA HISTORII KOMEND
DATA=$(date)
# ADRES DO WYSLANIA
EMAIL="wnowak@sigma.ug.edu.pl"
# 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
You can’t perform that action at this time.