Show More
@@ -5,8 +5,8 b' import os' | |||||
5 | import datetime |
|
5 | import datetime | |
6 | import sys |
|
6 | import sys | |
7 | import subprocess |
|
7 | import subprocess | |
8 |
logging.basicConfig(level |
|
8 | logging.basicConfig(level=logging.DEBUG, | |
9 |
format |
|
9 | format="%(asctime)s %(levelname)-5.5s %(message)s") | |
10 |
|
10 | |||
11 | class BackupManager(object): |
|
11 | class BackupManager(object): | |
12 | def __init__(self): |
|
12 | def __init__(self): | |
@@ -67,11 +67,17 b' class BackupManager(object):' | |||||
67 |
|
67 | |||
68 | subprocess.Popen(cmd) |
|
68 | subprocess.Popen(cmd) | |
69 | logging.info('Transfered file %s to %s', self.backup_file_name, cmd[4]) |
|
69 | logging.info('Transfered file %s to %s', self.backup_file_name, cmd[4]) | |
|
70 | ||||
|
71 | ||||
|
72 | def rm_file(self): | |||
|
73 | os.remove(self.backup_file_path) | |||
|
74 | ||||
70 |
|
75 | |||
71 |
|
76 | |||
72 | if __name__ == "__main__": |
|
77 | if __name__ == "__main__": | |
73 | bm = BackupManager() |
|
78 | bm = BackupManager() | |
74 | bm.backup_repos() |
|
79 | bm.backup_repos() | |
75 | bm.transfer_files() |
|
80 | bm.transfer_files() | |
|
81 | bm.rm_file() | |||
76 |
|
82 | |||
77 |
|
83 |
General Comments 0
You need to be logged in to leave comments.
Login now