Sunday, May 14, 2017

sftp Couldn't remove directory: Failure


using SFTP to connect to other servers , you ma get this error when trying to delete a folder "sftp Couldn't remove directory: Failure" , this because the folder is not empty , so try the command ls -a to show the hidden files , then remove them and try again .

Sometimes when you try to remove a full 100% folder (on Hetzner) , you cannot do that unless you use put command to replace the folder you want to remove by a null size folder with same name.

Note: that put command on ssh uses -r argument for the folders with identical names source and destination. which means it expects a folder with a same name from the command sftp -r source