Topic "Synchronize option creating empty directories"

Author Message
bkiesz
[View user's profile]

Joined: 2013-09-11
Posts: 3
I've been looking through the forums, docs, etc for a while now and I'm stumped..

What I'm trying to do basically copy files from my FTP server that are new. But knowing that my internet connection might not be as reliable as it should be, instead of setting my -filemask to 1day, I want to set it to 3 days, but not overwrite a file if it has already been downloaded. I just can't make that happen using 'get' and the time pattern options, etc. SO.. after scouring the forums, I found out that the 'synchronize' parameter would work; and it does except that while it doesn't download the files the that are already present within the -filemask time parameter, it still creates the folder structure. I end up with a bunch of empty folders that I don't want. Is there a way around this?

Ideally I would like to use the get with a file wildcard and time pattern. This is partly due to the fact that I have a number of files that I do not necessarily want to Synchronize..

Hopefully someone can shed some light on this for me.

Here's a sniplet of my scripts

Barry


-------------------------------------------------------------------------------
# Automatically abort script on errors

option batch on

# Disable overwrite confirmations that conflict with the previous

option confirm off

#Get Script
# Connect using a password
open ftp://user:***@host.com

# Change remote directory
cd /home/user/private/files
# Force binary mode transfer
option transfer binary
# Download file to the local directory K:\
get file1*.*>2H k:\files
get file3*.*>2H k:\files
# Disconnect
close
exit


#Synchronize script
# Automatically abort script on errors
option batch abort
# Disable overwrite confirmations that conflict with the previous
option confirm off
# Connect using a password
open ftp://user:xxxxx@host.com

# Change remote directory
cd /home/user/private/files
# Force binary mode transfer
option transfer binary
# Download file to the local directory K:\
synchronize -filemask=*.*>1D local K:\sync
# Disconnect
close
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
There's no way to do what you ask for, except for manually listing the folders in exclude mask.
_________________
Martin Prikryl
bkiesz
[View user's profile]

Joined: 2013-09-11
Posts: 3
prikryl wrote:
There's no way to do what you ask for, except for manually listing the folders in exclude mask.


Bummer!!

If I can't use the Synchronize feature, how about using the 'get' with wildcards, and time pattern matches,etc.. The issue I'm running into there is that if I set my time pattern for say 3 days and then have it run every day, it'll obviously detect the duplicate. How can I skip this duplicate (answer No) and continue downloading new files? I tried the Option Confirm Off, but it just errors the scripts and stops after the first duplicate file.

I appreciate your help on this!!!

Barry

-----------------------------------

# Automatically abort script on errors
option batch on
# Disable overwrite confirmations that conflict with the previous
option confirm off
#Get Script
# Connect using a password
open ftp://user:***@host.com
# Change remote directory
cd /home/user/private/files
# Force binary mode transfer
option transfer binary
# Download file to the local directory K:\
get file1*.*>3D k:\files
get file3*.*>3D k:\files
# Disconnect
close
exit
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
You can use "Newer only" option. Though it is not directly available in scripting.

See http://winscp.net/eng/docs/faq_script_ini
_________________
Martin Prikryl
bkiesz
[View user's profile]

Joined: 2013-09-11
Posts: 3
prikryl wrote:
You can use "Newer only" option. Though it is not directly available in scripting.

See http://winscp.net/eng/docs/faq_script_ini



Ahhh... Very cool.. I will go down that route and see where it takes me!! Thanks for your help; really appreciate it


Barry
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