added schedule backend to v2backups

This commit is contained in:
usman@cyberpersons.com
2023-04-05 23:03:49 +05:00
parent 193b82eed7
commit e803e3b9d2
4 changed files with 100 additions and 3 deletions

View File

@@ -294,6 +294,10 @@ class ProcessUtilities(multi.Thread):
if getpass.getuser() == 'root':
if os.path.exists(ProcessUtilities.debugPath):
logging.writeToFile(command)
if user!=None:
if not command.startswith('sudo'):
command = f'sudo -u {user} {command}'
if shell == None or shell == True:
p = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
else: