-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbackup143.py
57 lines (47 loc) · 1.47 KB
/
backup143.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
from sys import platform as _platform
import sys
import os
import ctypes
import time
import __main__
import threading
from bin.both.dbcon import dbmanager
db = dbmanager()
db.create()
from bin.both.log import LogginSystem
log = LogginSystem('service')
log.write('Detected Python version: ' + sys.version)
try:
is_admin = os.getuid() == 0
except AttributeError:
is_admin = ctypes.windll.shell32.IsUserAnAdmin() != 0
if is_admin == False:
print("[WARNING] You don't have Admin privileges! This may cause some Permission Error's while running a Backup!")
threads = []
if _platform == "win32" or _platform == "win64":
log = LogginSystem('service')
log.write('Detected OS: Windows')
try:
from bin.both.process import process
p = process()
t = threading.Thread(target=p.start)
threads.append(t)
t.start()
except ImportError as e:
log = LogginSystem('service')
log.write(str(e))
elif _platform == "linux" or _platform == "linux2" or _platform == "darwin":
log = LogginSystem('service')
log.write('Detected OS: Linux')
try:
from bin.both.process import process
p = process()
t = threading.Thread(target=p.start)
threads.append(t)
t.start()
except ImportError as e:
print("[ERROR] Linux Service Failed: " + str(e))
log = LogginSystem('service')
log.write("Linux Service Failed: " + str(e))
else:
print("Your OS isn't supported!")