helpdesk talks
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
327 B

  1. #! /bin/bash
  2. if [ -z "$1" ]
  3. then
  4. WORK=Downloads/college
  5. else
  6. WORK=$1
  7. fi
  8. echo "Do you want to backup ~/$WORK directory? (yes/no)"
  9. read n
  10. if [ $n = yes -o $n = y ] ; then
  11. if [ ! -d ~/backups ] ; then
  12. mkdir ~/backups
  13. fi
  14. DEST=~/backups
  15. NAME=work-$(date +%d%-m%-y%).tar.gz
  16. tar -zcvf $DEST/$NAME ~/$WORK
  17. fi