Skip zero byte files

Advertisement

DWVZ2000
Joined:
Posts:
10
Location:
USA

Skip zero byte files

We have programs that create numerous files to be transferred to FTP sites. Sometimes some of these files end up with nothing in them, a file size of 0 bytes simply because there is no data for that particular day. When I run WinScp to transfer the files, it transfers all files including the empty files with 0 bytes. We transfer a number of files daily, and the users of the FTP sites I am transferring to don't want me to transfer 0 byte files. Is there a way to only transfer files that have a file size greater than 0 bytes? Basically skip files that have 0 byte size?

Thanks,

David

Reply with quote

Advertisement

DWVZ2000
Joined:
Posts:
10
Location:
USA

Re: Skip zero byte files

martin wrote:


Using the size option I either get an error file not found using below :
""put \\Moss\departments\ePremis\MEDASSIST\" & "*%TimeStamp#mmddyyyy%" &
".TXT>1K"" & ""exit"" "

OR using code below it runs but doesn't find the files > 1K
""put \\Moss\departments\ePremis\MEDASSIST\" & "*%TimeStamp#mmddyyyy%" & ".TXT"
& ">1K"" & ""exit"" "

What am I doing wrong?

Thanks,

David

Reply with quote

DWVZ2000
Joined:
Posts:
10
Location:
USA

Re: Skip zero byte files

Here's the command I am using AND
I have attached a screen shot of what I get.
I put the space between the "put" and the "exit".
Here is the name of the file I am trying to transfer that is > 1K.

Thanks,

David
  • winscp1.jpg (51.32 KB, Private file)
Description: Screen shot where winscp doesn't find file > 1K. File name is MEDASSIST_PLC_12032015.TXT

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Skip zero byte files

My fault.

I didn't realize it's a mask for a local file, where the size criteria does not work directly.

You have to use -filemask switch:

put \\Moss\departments\ePremis\MEDASSIST\*%TimeStamp#mmddyyyy%.TXT -filemask=>1K

Reply with quote

DWVZ2000
Joined:
Posts:
10
Location:
USA

Re: Skip zero byte files

martin wrote:

My fault.

I didn't realize it's a mask for a local file, where the size criteria does not work directly.

You have to use -filemask switch:

put \\Moss\departments\ePremis\MEDASSIST\*%TimeStamp#mmddyyyy%.TXT -filemask=>1K

THANK YOU VERY MUCH. I finally have it working.

Reply with quote

Advertisement

You can post new topics in this forum