Gostaria de remover uma pasta no meu servidor FTP, hospedado pelo PureFtpd, em um script, para automatizar essa tarefa. Tenho um script bash como esse:
#!/bin/sh
HOST=myhost.com
USER=my-user
PASSWORD=my-password
ftp -inv $HOST <<EOF
user $USER $PASSWORD
cd /folder_A
ls
rmdir -r assets
bye
EOF
O servidor fornece este feedback:
Connected to myhost.com.
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 1 of 160 allowed.
220-Local time is now #####. Server port: 21.
220-This is a private system - No anonymous login
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 5 minutes of inactivity.
331 User my-user OK. Password required
230-Your bandwidth usage is restricted
230 OK. Current restricted directory is /
Remote system type is UNIX.
Using binary mode to transfer files.
250 OK. Current directory is /folder_A
200 PORT command successful
150 Connecting to port 49849
drwxr-xr-x 3 3012 my-user 3 Oct 8 07:29 .
drwxr-xr-x 11 3012 my-user 16 Oct 7 22:49 ..
drwxr-xr-x 3 3012 my-user 13 Oct 7 22:46 assets
226-Options: -a -l
226 3 matches total
550 Can't remove directory: No such file or directory
221-Goodbye. You uploaded 0 and downloaded 0 kbytes.
221 Logout.
Entendo que a pasta "assets" não existe, mas a exploração do Filezilla me mostrou que a pasta ainda está presente.
Tentei executar sem sucesso o seguinte comando:
rmdir -r /folder_A/assets
Muitas buscas no Google não forneceram nenhuma solução. A próxima ideia é tentar o ChatGPT...