Topic "Put folders without files on an FTP site"

Author Message


So i programatically create folders on my server with a script whenever we get a new client. I have a script that checks and, if needed,sends the files the client uploads every 30 minute to the server then deletes the local copy from the ftp server

I want to synch my local FTP repository with the FTP folders on the FTP server. so if i create a folder with client 1, i want to FTP create a folder on the FTP server called client 1, then i make a client 2, it creates a folder on client 2 once a script is run. basically just sync up my local directory and delete everything in the remote directory (the FTP server) if that folder doesn't exist on my local server. We have people that create the client logins and i just want the folders there so they cant mess up the permissions.

Problem is i don't want to do this with any files, just the folder names, because i don't want to send the files on the FTP repository back to the FTP server. Maybe once overnight, just check the folders on the FTP server with the folders on my server and add and delete the names to keep them synchronized. Anyone have an idea how i can accomplish this with a simple command?
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 27083
Location: Prague, Czechia
Just run synchronize remote scripting command with file mask |* (exclude all files) and -delete switch (to remove orphaned remote folders)

synchronize remote C:\local\path /remote/path -delete -filemask=|*

I strongly recommend a dry run with -preview switch before you run it live for the first time.

You can post new topics in this forum


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!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License