I’m trying to retrieve the free available disk space I have on my SFTP server. The SFTP server runs on Windows platform and my SFTP client is running on a Linux Docker container. I am using SFTP Paramiko API. I do not have ssh installed on my docker container. Anyone got any idea?
I’m trying to get the free space of drive C
of my SFTP server running on Windows.
This piece of code below runs in my Docker container.
def get_free_space(host, port, user, pwd):
client = paramiko.client.sshclient()
client.connect(host, user, pwd)
stdin, stdout, stderr = client.exec_command(“df -h” + “C:/“)
print(stdout.readlines())
print(stderr.readlines())
However, there is this error stating
'df' is not recognized as an internal or external command, operable program or batch file.