I use SFTP server for making database backup and all web site with it structure. I use bad script and now I make double duplicates on my SFTP server. I use rmdir folder
but I get error:
Couldn't remove directory: Failure
If I understand right in SFTP I can remove directory just if it empty. And if I use rm folder/*
I don't remove inner folders.
How I can doit another way?
To remove any directory from your remote SFTP session, run the following rmdir command followed by the directory you want to (in this example, directoryA will be removed).
To remove a directory and all its contents, including any subdirectories and files, use the rm command with the recursive option, -r . Directories that are removed with the rmdir command cannot be recovered, nor can directories and their contents removed with the rm -r command.
You can also mount your remote directory with
sshfs [email protected]:/path/to/remote local/path
then just cd local/path
and then you are free to use rm -r folder
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With