Topic "Downloading only specific files with command script"

Author Message
jericho2
[View user's profile]

Joined: 2015-02-17
Posts: 4
Location: Ponca City, OK
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?
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
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
jericho2
[View user's profile]

Joined: 2015-02-17
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
jericho2
[View user's profile]

Joined: 2015-02-17
Posts: 4
Location: Ponca City, OK
So on the last line of my script would this give me what I want to accomplish?

synchronize local y:\CMR\-filemask="|*/" *
jericho2
[View user's profile]

Joined: 2015-02-17
Posts: 4
Location: Ponca City, OK
prikryl 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?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
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="|*/"
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License