Re: when synchronize create remote directory if not exists
I think the docs say there's a way to ignore this and continue on but I wasn't able to get it to work.
https://winscp.net/eng/docs/scriptcommand_option
I think the docs say there's a way to ignore this and continue on but I wasn't able to get it to work.
No it was not. Why don't you just create the directory?
Thanks for the explanation. Will consider it.
Not sure, if I understand you. As I wrote, subdirectories are created.
So if you execute:synchronize remote c:\web /home/username/httpdocs
only thehttpdocs
needs to exist.
If there'sc:\web\images
, but not/home/username/httpdocs/images
, theimages
subfolder is created.
‘--parents’
Form the name of each destination file by appending to the target directory a slash and the specified name of the source file. The last argument given to cp must be the name of an existing directory. For example, the command:
cp --parents a/b/c existing_dir
copies the file a/b/c to existing_dir/a/b/c, creating any missing intermediate directories.
mkdir c:\web; cd c:\web
synchronize local -parents c:\web /home/username/httpdocs
if c:\web\home\username\httpdocs does not exist, then
mkdir home; mkdir home\username; mkdir home\username\httpdocs;
get /home/username/httpdocs/* c:\web\home\username\httpdocs
else
synchronize c:\web\home\username\httpdocs /home/username/httpdocs
mkdir -parents
option?
Sometimes there is a need to sync a few subfolders only
e.g. Desktop,Documents,Music insides user profile directory, as there is too many garbage insides
Not sure, if I understand you. As I wrote, subdirectories are created.
So if you execute:synchronize remote c:\web /home/username/httpdocs
only thehttpdocs
needs to exist.
If there'sc:\web\images
, but not/home/username/httpdocs/images
, theimages
subfolder is created.
synchronize remote c:\web /home/username/httpdocs
only the httpdocs
needs to exist.
c:\web\images
, but not /home/username/httpdocs/images
, the images
subfolder is created.
The root destination directory has to exist prior to synchronization. Any absent sub-directories will be created.