Guest User

Untitled

a guest
May 19th, 2014
175
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2.     BACKUPDIR=$HOME/Backups
  3.     BACKUPFILES="$HOME/.xchat2 $HOME/.Skype"
  4.     TARFILE=$HOME/Backups/$DATE
  5.     BZIPFILE=$HOME/Backups/$DATE.tar.bz2
  6.     LOGFILE=$HOME/Backups/logs/Backup.log
  7.  
  8. (
  9. echo "10" ; sleep 1
  10. echo "#Creating Required  Directory Tree" ; sleep 1
  11. mkdir -p $HOME/Backups/logs
  12. mkdir -p $HOME/Backups/old
  13.  
  14. echo "20" ; sleep 1
  15. echo "#Changing directory" ; sleep 1
  16. cd $HOME/Backups
  17.  
  18. echo "50" ; sleep 1
  19. echo "#Creating Backup " ; sleep 1
  20. tar cf $TARFILE $BACKUPFILES > /dev/null 2>&1
  21.  
  22. echo "75" ; sleep 1
  23. echo "#Cleaning up & Adding entry to log file" ; sleep 1
  24. mv $BZIPFILE $HOME/Backups/old
  25. bzip2 $TARFILE
  26. date >> $LOGFILE
  27. echo backup succeeded >> $LOGFILE
  28.  
  29. echo "100" ; sleep 1
  30. ) |
  31. zenity --progress \
  32.   --title="please wait" \
  33.   --percentage=0
  34.  
  35. if [ "$?" = -1 ] ; then
  36.         zenity --error \
  37.           --text="Action cancelled."
  38. fi
RAW Paste Data