Add CLI for managing SFTP recording backups
Android checks / cli (push) Canceled after 0s
Android checks / verify (push) Canceled after 0s

This commit is contained in:
Meghdad committed 2026-10-16 16:04:53 +03:30
1 parent 27cf823959
commit 8588c2f3ad
21 files changed
+1732 -2

No files matched your search

+30
View File
@@ -117,11 +117,41 @@ def main():
def rename(self, old, new):
try:
if self.local(new).exists():
raise FileExistsError(17, "Target exists")
self.local(old).rename(self.local(new))
return paramiko.SFTP_OK
except OSError as error:
return paramiko.SFTPServer.convert_errno(error.errno)
def posix_rename(self, old, new):
try:
self.local(old).replace(self.local(new))
return paramiko.SFTP_OK
except OSError as error:
return paramiko.SFTPServer.convert_errno(error.errno)
def mkdir(self, path, attr):
try:
self.local(path).mkdir(mode=0o700)
return paramiko.SFTP_OK
except OSError as error:
return paramiko.SFTPServer.convert_errno(error.errno)
def rmdir(self, path):
try:
self.local(path).rmdir()
return paramiko.SFTP_OK
except OSError as error:
return paramiko.SFTPServer.convert_errno(error.errno)
def chattr(self, path, attr):
try:
paramiko.SFTPServer.set_file_attr(self.local(path), attr)
return paramiko.SFTP_OK
except OSError as error:
return paramiko.SFTPServer.convert_errno(error.errno)
transports = []
threads = []