Skip to content

Instantly share code, notes, and snippets.

@PythonicNinja
Created December 14, 2011 11:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PythonicNinja/1476216 to your computer and use it in GitHub Desktop.
Save PythonicNinja/1476216 to your computer and use it in GitHub Desktop.
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