Answer the question
In order to leave comments, you need to log in
How to delete file in FTP storage using bash?
Hello. I'm trying to execute a script.
# !/bin/bash
echo "Получаю доступ к фтп"
sudo sh -c "ncftpput -u логин -p пароль адрес /"
echo "Начинаю очищать хранилище"
#Допишу потом.
ls
echo "Хранилище очищено | $(date +%y%m%d)"
sudo sh -c "ncftpput -u логин -p пароль адрес /"
Answer the question
In order to leave comments, you need to log in
How to delete a file from FTP storage with one command using bash? Or suggest your own way.
HOST="192.168.1.1"
USER="root"
PASS="12345"
DATE=$(date +%y%m%d)
CMD="\
echo 'Начинаю очищать хранилище';\
ls /;\
echo 'Очищаю .. rm -rf lalala';\
echo 'Хранилище очищено '$DATE;\
exit"
lftp -e "$CMD" --user $USER --password $PASS $HOST
lftp -e "ls /;rm -rf file.txt;exit" --user root --password 12345 192.168.1.1
you mount it into the system + delete rm
if the server is puffed, then you can use the server, (here I'm not special, spree = it will cost one line (in the sense of code)
if there are rights
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question