Guest User

NAS_BKP

a guest
May 26th, 2013
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.52 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #AKTUALIS DATUM MEGHATAROZASA
  4. datum=$(date +%Y_%m_%d)
  5.  
  6. #TORLENDO DATUM MEGHATAROZASA
  7. regidatum=$(date --date '7 days ago' +%Y_%m_%d)
  8.  
  9.        
  10.  
  11. #REGI MENTES TORLESE
  12.  
  13. if test -d "/home/informatika/NAS_BACKUP/$regidatum"; then
  14.  
  15. rm -rf /home/informatika/NAS_BACKUP/$regidatum
  16.  
  17. echo "Regi mentes torolve..."
  18.  
  19. else
  20. echo "Nincs egy hetes mentes..."
  21. fi
  22.  
  23. #MENTES A NAS-RA
  24. mkdir /home/informatika/NAS_BACKUP/$datum/
  25.  
  26. tar pcf "/home/informatika/NAS_BACKUP/$datum/home.tar" "/home/"
  27.  
  28. echo "Mentes kesz!"
Advertisement
Add Comment
Please, Sign In to add comment