Created
July 4, 2013 11:00
-
-
Save include/5926793 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# -*- conding: UTF-8 -*- | |
import sys | |
import os | |
import time | |
def main(): | |
'''yep this is an awesome but tiny test''' | |
if len(sys.argv) < 3: | |
print "define dir to backup and backup destination" | |
sys.exit(1) | |
else: | |
backup_dir = sys.argv[1] | |
backup_file = time.localtime() | |
backup_dest = sys.argv[2] | |
cmd = "tar -czvf " + str(backup_file.tm_hour) + ".tar.gz " + backup_dir | |
if os.system(cmd) == 0: | |
print "YHE" | |
else: | |
print "backup failed" | |
if __name__ == '__main__': | |
main() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment