Looking for Help in automating code

Advertisement

shadow5631
Guest

Looking for Help in automating code

Hello,

I am new to WinSCP and scripting and was looking for some guidance on how to accomplish automating the application. My intent is to have a script that compares the remote and local directories to each other. If the folder exists on the local directory, then have the program check to see if the files in that folder on the remote directory are the same as the local one. If not, download the files from the remote directory to the local one. An Example would be

Remote Dir: /home/DIR1
in that dir would be /home/DIR/FOLDER_A , /home/DIR/FOLDER_B, /home/DIR/FOLDER_C, /home/DIR/FOLDER_D, etc.

Local Dir: D:DIR1
in that dir would be D:DIR/FOLDER_A , D:DIR/FOLDER_B, D:DIR/FOLDER_C, /D:DIR/FOLDER_D, etc.

So if FOLDER_F exists on the remote Dir and not on the local Dir, then it would be ignored.

If FOLDEER_F exists on both the remote Dir and local Dir then the program would check the contents of the remote Dir and if new files exist, it would download to the local Dir.

Please let me know where to start, as Im not sure what launge or scripts to use.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
28,671
Location:
Prague, Czechia

Re: Looking for Help in automating code

WinSCP cannot ignore folders not existing on the other side.
It can ignore all files and folders not existing on the other side, if that helps.

Otherwise, your only option is to synchronize the known subfolders one-by-one.
You can write a simple script in your favorite language to generate synchronization script for each subfolder.

Reply with quote

Advertisement

You can post new topics in this forum