1. #! /bin/bash
  2. YELLOW="\033[1;33m"
  3. RED="\033[0;31m"
  4. ENDCOLOR="\033[0m"
  5.  
  6. ## pack files
  7. echo -e $YELLOW"Packing files..."$ENDCOLOR
  8.  
  9. cd /home/user/textfolder/
  10. tar cvf /home/user/yourtext-backup.tar *.*
  11. echo -e $YELLOW"... files packed!"$ENDCOLOR
  12.  
  13.  
  14. ## list packed file
  15. echo -e $YELLOW"Contents of yourtext-backup.tar:"$ENDCOLOR
  16. tar tvf /home/user/yourtext-backup.tar
  17.  
  18. ## send packed file
  19. echo -e $YELLOW"Sending packed file..."$ENDCOLOR
  20. sendEmail -f backupemail@gmail.com -t youremail@gmail.com -u "Current backup" -m "Backup" -a /home/user/yourtext-backup.tar -s smtp.gmail.com:25 -xu backupemail -xp password
  21.  
  22. echo -e $YELLOW"... Backup done!"$ENDCOLOR
  23. cd -
  24.  
  25. ## This script is released under the WTFPL 2.0. Modify and distribute as you wish.
  26. ## The script needs the sendemail program to work.