How to download files with a specific extension only from an FTP server?

6,296

wget supports recursive download and accept lists which should cover this use case.

wget -r -np -A "*.torrent" ftp://ftp.fau.de/gimp/gimp/

The file-extension should be specified.

The command will recursively download all files ending in torrent from ftp://ftp.fau.de/gimp/gimp/ .

If you want to remove the directory structure and have all files in the current working direcotory add -nd to the argument list.

If you want to skip downloads for files which already exist in the target directory, add -nc to the argument list.

Share:
6,296

Related videos on Youtube

Kalle Richter
Author by

Kalle Richter

Updated on September 18, 2022

Comments

  • Kalle Richter
    Kalle Richter over 1 year

    I'd like to batch download .torrent files from a FTP server (e.g. ftp://ftp.fau.de/gimp/gimp/) with one command or one click in a GUI (after entering the hostname and the root directory). The aim is to have all the .torrent file under a root on the FTP server in a directory so that they can be batch added to a torrent client, like Deluge GTK.

    In Filezilla I still have to open all directories and click on all of the torrent files.

  • Kalle Richter
    Kalle Richter over 6 years
    Thank you. Any way to avoid downloading a file twice if it's found at more than one location, like on cdimage.ubuntu.com (not FTP, but the above works as well) (there's no duplicate file created, but the download is unnecessary)?
  • LangeHaare
    LangeHaare over 6 years
    @KarlRichter you might find a solution for that here? (unless I've misunderstood the problem) stackoverflow.com/questions/4944295/…