Need help to automatically download from file server

Discussion in 'Mac Programming' started by Fzang, Jan 11, 2015.

  1. Fzang macrumors 65816

    Fzang

    Joined:
    Jun 15, 2013
    #1
    Basically, the files are laid out

    URL/file001.extension
    URL/file002.extension
    URL/file003.extension
    URL/file....

    And so forth.

    Is there any way I can automatically access and download all instances of URL/file***.extension simultaneously?
     
  2. superscape macrumors 6502a

    superscape

    Joined:
    Feb 12, 2008
    Location:
    East Riding of Yorkshire, UK
    #2
    I'm not 100% sure how you mean. Are the files in a mounted share (e.g. over afp, smb) or are you getting at them over http (e.g. downloading them from a website).

    Either way, using a shell command is probably going to be the best bet.
     
  3. MasConejos macrumors regular

    MasConejos

    Joined:
    Jun 25, 2007
    Location:
    Houston, TX
    #3
    "curl URL/file[001-100].extension" form the command line might do it. Replace 100 with whatever the final file number is
     
  4. superscape macrumors 6502a

    superscape

    Joined:
    Feb 12, 2008
    Location:
    East Riding of Yorkshire, UK
    #4
    Yup, if you're downloading over HTTP then curl is a sensible way forward as suggested above. If it's a share you have mounted then you can do it like this:

    Code:
    find /Volumes/rest/of/your/path -name "file[0-9][0-9][0-9].jpg" -exec cp "{}" /path/to/folder/on/your/mac/ \;
    If you're not sure of the paths then remember that you can drag a folder to the Terminal to find them out.

    Hope that's of some help.
     

Share This Page