Advertisement
R0lf_R1s1k0

Backup

Nov 11th, 2016
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.34 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #By default home is backed up, but you can of course change it (You need read permissions or you will get errors)
  4.  
  5. DATE=$(date +%d-%m-%Y)
  6. printf "Destination?: "
  7. read BPATH
  8. SOURCE=$HOME
  9. if [ ! -d $BPATH ];then
  10.     printf "Path does not exist, aborting"
  11. else
  12.     tar -cjpf $BPATH/backup-$DATE.tar.bz2 $SOURCE
  13.     printf "Done"
  14. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement