Advertisement
Guest User

Quick Backup Script

a guest
Jan 14th, 2016
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. if
  4.  
  5. mkdir /tmp/remote-folder
  6.  
  7. mount -t cifs -o username=“user”,password=“pass” //server/“backups-folder” /tmp/remote-folder
  8.  
  9. then
  10.  
  11. name=$(date '+%y-%m-%d')
  12.  
  13. tar -czf - ~/ --exclude=/home/user/"folderwithhugedata" | pv > /tmp/remote-folder/$name-backup.tgz
  14.  
  15. umount /tmp/remote-folder
  16.  
  17. rm -rf /tmp/remote-folder
  18.  
  19. echo 'That was smoothly nice ... you rock!'
  20.  
  21. else
  22.  
  23. echo 'Something´s f*ck´d here!'
  24.  
  25. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement