1

Consider this:

  • I have ftp server ABC
  • ~30GB and thousands of directories and files
  • I have read only user to this ftp
  • this is not my server, I do not have access to it's administration/configuration

Can I create FTP mirror with version control?

I wanted to automatically sync this ABC server with my local copy and next I wanted to make a commit with some version control system. Are there any existing tools for such thing (doesn't matter linux or windows)?

First thought - to use WinSCP automatic synchronization commands and when it finish make commit with SVN - is this good solution?

BlueMark
  • 1,089
  • 1
  • 9
  • 8

1 Answers1

3

You could write a batch file that does the following:

1) winscp synchronize to get the files
2) svn add to version control any new files
3) svn commit at the end to commit the files

Keep in mind that Version Control works best with text based files.


Example

This example works for me:

winscp /script=config.txt /log=log.log /xmllog=log.xml
svn add C:\localFTP\root --force
svn commit C:\localFTP\root\ -m "commit after ftp synchronize"

Where config.txt is this:

open ftp://Anonymous:pass@ftp.example.com
synchronize local C:\localFTP\root /remote/path
exit

Notes

1) Run the bat from C:\localFTP

2) If winscp is not in the %PATH% add it or put this at the top of the bat file:

SET PATH=%PATH%;C:\Program Files (x86)\WinSCP\

3) svn should be in the %PATH% if it isn't you will need to add it

Tim Penner
  • 1,889
  • 14
  • 22