0

I have about 1,000,000 files and I should do FTP to get some specific files. in 1,000,000 files with the name of ML0000000-ML1000000 i want specific file starts ML00002222 till ML00899999. can anyone help me how to edir mget for ftp ?

######login to FTP server:@@@@@
ftp -inv 172.0.0.1
user Codegirl $$$$
#######cd to ftp server#########
cd /root/desktop
######cd to local PC#############
lcd /root/myfile
*mget ML*   ??? (how can i change it to specific file name?)*
Marco Bonelli
  • 63,369
  • 21
  • 118
  • 128
CodeGirl
  • 81
  • 8

1 Answers1

1

If it was me I'd use a loop and wget.

cd /root/myfile

for i in $(seq -f "%08g" 2222 899999)

do
  wget --username=un --password=pw ftp://172.0.0.1/root/desktop/ML${i}
done

This does require wget to reconnect each time, it's going to take time anyway so go and run the script and grab a cup of tea. I use loops like this all the time and it works well.

nelgin
  • 36
  • 2
  • this works but do not download the file i see the file which counts but the file does not copied! also it is slow. is it any way to do it faster! – CodeGirl Jul 21 '20 at 10:20