Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Using filemask with keepuptodate


@echo off
cd C:\Program Files (x86)\WinSCP
winscp.com /ini=nul /command ^
"open sftp://(My Credentials)" ^
"keepuptodate -filemask=""*|*\My Music\; *\My Pictures\; *\My Videos\; *\Rainmeter\"" C:\Users\rwalk\Documents\ /home/robert/Network_Files/Documents" ^
"exit"


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

Update:
I realized I had a syntactical error in my initial command, and changed it to:
"keepuptodate -filemask=|My Music\; My Pictures\; My Videos\; Rainmeter\ C:\Users\rwalk\Documents /home/robert/Network_Files/Documents"

However, when I run the updated script I get the error:

Too many parameters for command 'keepuptodate'.
At this point I'm pretty sure I'm just missing some sort of a closer on the -filemask statement, but I'm not sure what.
rwalk

Using filemask with keepuptodate

Hello all,
I'm working on a script to keep the Documents directory on my server synchronized with the Documents directory on my computer. My goal is to have a script that launches when Windows starts up and runs the keepuptodate command. I want to exclude certain directories inside of Documents from the upload, so I used the filemask command. Here is the script I wrote:

@echo off

cd C:\Program Files (x86)\WinSCP
winscp.com /ini=nul /command "open sftp://(My Credentials)" "keepuptodate -filemask="*|*\My Music\; *\My Pictures\; *\My Videos\; *\Rainmeter\" C:\Users\rwalk\Documents\ /home/robert/Network_Files/Documents" "exit"

However, running this script returns:
The filename, directory name, or volume label syntax is incorrect.


At first I thought I had some sort of syntax error, but I found that I can run each command individually in the command prompt of WinSCP and it functions (e.g. I run "open sftp..." etc. and then "keepuptodate...")
So, does anyone have any ideas what might be causing this problem and how to prevent it?
I'm using WinSCP Version 5.11.3 with Microsoft Windows 10.
Thanks!