Downloading only specific files with command script

Advertisement

jericho2
Joined:
Posts:
4
Location:
Ponca City, OK

Downloading only specific files with command script

First time poster here. I am new to scripts so bear with me. I am trying to edit a script that someone else wrote who used to work here. The problem I am having is that one of the ftp sites has changed and I need to set it up to download file from the new site. In this new site the folder my files are in has a sub folder with archives of past files (its a weekly radio show with audio files) What I need is for only the current week's files to be downloaded and NOT the sub folder.

Here is the command I have currently have.

cd "/home/nrtsyndication/nrtsyndication.com/syndication/Christian_Music_Rewind/"

This command successfully downloads all the files within that subfolder. However there is another folder within the "Christian_Music_Rewind" folder that has large archive files. How can I change this command so it only downloads the audio files within the this specific sub folder and not the other folder another step down?

Reply with quote

Advertisement

jericho2
Joined:
Posts:
4
Location:
Ponca City, OK

Here is the entire script that relates to this ftp download. Maybe someone can tell me what I need to do to ignore any folders below the current working directory.

open cmr
cd "/home/nrtsyndication/nrtsyndication.com/syndication/Christian Music Rewind/"
synchronized local y:\CMR\
close

Reply with quote

jericho2
Joined:
Posts:
4
Location:
Ponca City, OK

Re: Downloading only specific files with command script

martin wrote:

The cd command does not transfer anything. It changes a current remote working directory only.
You probably have get command later. Add -filemask="|*/" to that to exclude all subfolders.
See https://winscp.net/eng/docs/faq_script_non_recursive

I'm getting an error with this line

synchronize local y:\CMR\-filemask="|*/"

Can someone tell me what I need to change to make it work?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,517
Location:
Prague, Czechia

Re: Downloading only specific files with command script

jericho2 wrote:

I'm getting an error with this line

synchronize local y:\CMR\-filemask="|*/"

Can someone tell me what I need to change to make it work?
There has to be a space between synchronize command parameters and the -filemask switch:
synchronize local y:\CMR\ -filemask="|*/"

Reply with quote

Advertisement

You can post new topics in this forum