Topic "need synchronize the directories and files of 2015, but not the entire year, just May and Sept."

Author Message
leonardo07746
[View user's profile]

Joined: 2015-08-06
Posts: 8
Location: cuba
good afternoon, now I suddenly need to re-write my script and need to add a feature that might synchronize the directories and files from two months within the past year 2015, I'm still reading Newer and updated files only under https://winscp.net/eng/docs/ui_transfer_custom#other but it keeps my head spinning, still don't know whether I'm on a good lead article or not.help,thanks
_________________
leo
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Use a file mask with a time constraint:

synchronize C:\local /remote -filemask="*>=2015-05-01<2015-06-01,*>=2015-09-01<2015-10-01"

See https://winscp.net/eng/docs/file_mask#size_time
leonardo07746
[View user's profile]

Joined: 2015-08-06
Posts: 8
Location: cuba
martin wrote:
Use a file mask with a time constraint:

synchronize C:\local /remote -filemask="*>=2015-05-01<2015-06-01,*>=2015-09-01<2015-10-01"

See https://winscp.net/eng/docs/file_mask#size_time






Many many thanks, then my script must to say something like this:

Quote:
winSCP.com /command ^
"option batch abort" ^
"open ftp://ftpmetropolitano:ftpmetro@192.168.x.x/" ^
"synchronize local -filemask="*>=2016-06-01 00:00:00" C:\Sabic\JOURNAL /Journals/TRASVAL/" ^
"/log=C:\LOGS_JOURNALS\logsdelScript_!Y_!M_!D_!T.log" /loglevel=1 "
"close" ^
"quit"


the date've changed because my crazy bosses said they're more interested in the files updated after Jun, is the sintaxis of the script all right?
thanks
_________________
leo
leonardo07746
[View user's profile]

Joined: 2015-08-06
Posts: 8
Location: cuba
leonardo07746 wrote:
martin wrote:
Use a file mask with a time constraint:

synchronize C:\local /remote -filemask="*>=2015-05-01<2015-06-01,*>=2015-09-01<2015-10-01"

See https://winscp.net/eng/docs/file_mask#size_time






Many many thanks, then my script must to say something like this:

Quote:
winSCP.com /command ^
"option batch abort" ^
"open ftp://ftpmetropolitano:ftpmetro@192.168.x.x/" ^
"synchronize local -filemask="*>=2016-06-01 00:00:00" C:\Sabic\JOURNAL /Journals/TRASVAL/" ^
"/log=C:\LOGS_JOURNALS\logsdelScript_!Y_!M_!D_!T.log" /loglevel=1 "
"close" ^
"quit"


the date've changed because my crazy bosses said they're more interested in the files updated after Jun, is the sintaxis of the script all right?
thanks




nah, not that way, that way it saved the files to C:\program files\Winscp\ instead to the location that I'm indicating to save them c:\sabic\journal\, I changed it by doing some research and this did the magic:

Quote:
winSCP.com /command ^
"option batch abort" ^
"open ftp://ftpmetropolitano:ftpmetro@192.168.x.x/" ^
"synchronize local C:\Sabic\JOURNAL /Journals/TRASVAL -filemask=*>"2016-09-20 08:10:00" ^
"/log=C:\LOGS_JOURNALS\logsdelScript_!Y_!M_!D_!T.log" /loglevel=1 "



Voila!! thanks
_________________
leo
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
The actual problem are the quotes.

This is correct:
"synchronize local C:\Sabic\JOURNAL /Journals/TRASVAL -filemask=""*>2016-09-20 08:10:00""" ^

And then the argument other does not matter. This would still work:

"synchronize local -filemask=""*>2016-09-20 08:10:00"" C:\Sabic\JOURNAL /Journals/TRASVAL" ^

See https://winscp.net/eng/docs/commandline#syntax

In your version, I'm pretty sure that the "08:10:00" part was ignored.

Also, the /log must be at the very end (or before the /command). Otherwise the close and exit commands are never invoked.

So a full correct script is like:

Code:
WinSCP.com /command ^
  "option batch abort" ^
  "open ftp://ftpmetropolitano:ftpmetro@192.168.x.x/" ^
  "synchronize local ""-filemask="*>=2016-06-01 00:00:00"" C:\Sabic\JOURNAL /Journals/TRASVAL/" ^
  "close" ^
  "quit" ^
  /log="C:\LOGS_JOURNALS\logsdelScript_!Y_!M_!D_!T.log" /loglevel=1
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