Advertisement
Guest User

atao

a guest
Feb 13th, 2014
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.02 KB | None | 0 0
  1. #          _       _                                        
  2. #     __ _| |_ __ (_)                                      
  3. #    / _` | | '_ \| |                                      
  4. #   | (_| | | |_) | |                                      
  5. #    \__, |_| .__/|_|                                      
  6. #    |___/  |_|                                      _      
  7. #   / ___|  __ _ _   ___   _____  __ _  __ _ _ __ __| | ___
  8. #   \___ \ / _` | | | \ \ / / _ \/ _` |/ _` | '__/ _` |/ _ \
  9. #    ___) | (_| | |_| |\ V /  __/ (_| | (_| | | | (_| |  __/
  10. #   |____/ \__,_|\__,_| \_/ \___|\__, |\__,_|_|  \__,_|\___|
  11. #                                |___/                      
  12. #
  13. import os
  14. import time
  15.  
  16. #Variables
  17. ancien = "glpi.tar.gz"
  18.  
  19. #Recuperation de la date
  20. madate = time.strftime('%d-%m-%y_%H:%M',time.localtime())
  21.  
  22. #Concatenation du nouveau nom
  23. nouveau="glpi_"+madate+".tar.gz";
  24.  
  25. #Creation de l'archive
  26. os.system("tar cvjf glpi.tar.gz glpi")
  27.  
  28. #Renommage de l'archive
  29. os.renames(ancien,nouveau)
  30. print "Backup ---> [OK]"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement