The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.
The Guiding Principles and New Rules document is now in effect.
one-way synchronization --SOLVED look inside for step-by-step instructions
RamiusJoined: July 19, 2000Administrator, ClubPAadmin
I've searched google unsuccessfully, so perhaps someone could help me out.
I'm looking for a FREE utility that will run on Windows XP, preferably running all the time in the system tray, which I can configure to watch a certain directory and any time a new file or files are added, it will either:
Send those files over an SSH connection to a directory on my webserver, OR
launch some batch file or other program with each file that it found (then I can setup the intermediary program that does the uploading to the webserver)
I never found one, so ended up using a vbscript. it would check the dir, transfer any found files via FTP, log it, then sleep for 10 seconds and check again.
RamiusJoined: July 19, 2000Administrator, ClubPAadmin
edited September 2008
Blech, yeah I'm familiar with the FileSystemWatcher stuff, so I know this should be relatively easy to program, which is why I expect someone else to have already done the work for me.
So thanks for the idea, but I'd rather just download+install something if it exists (which it should, in any sensible world).
Directory Monitor
Download (version 1.0.1.4)
Features
* Monitor directories for file changes, modifications, deletions and new files.
* Monitor local directories or network shares (including hidden shares).
* Optionally execute an application when an event occurs.
* Quickly tell if a directory is available and being monitored.
* Balloon notifications whenever an event is fired.
* Auto updating, import/export and more.
* FREE!
Disclaimer - I have never used this or heard of this guy before.
The program that PirateJon linked doesn't seem to support transferring the files, but you could you rsync to handle the transfer over SSH. There is an unofficial package for Windows that doesn't require a normal Cygwin installation, but I haven't used it myself since there are official Linux builds of rsync :P
Barrakketh on
Rollers are red, chargers are blue....omae wa mou shindeiru
0
RamiusJoined: July 19, 2000Administrator, ClubPAadmin
edited September 2008
yeah, I had a strong feeling rsync could do it, but I knew there would be a learning curve and I wanted to avoid it if possible.
In the end, I got it working like this:
1) download the cwRsync installer from here (homepage)
5) Open a command prompt, situate yourself in the c:\util\CwRsync\bin directory, and then loosely follow these directions.
- Note that cwrsync comes with both the ssh and ssh-keygen utilities that are needed
- Note that if you have some other 'ssh' in your path, you should use the absolute path to the cwrsync, like so: rsync -avz -e "c:\util\cwrsync\bin\ssh" /this/dir/ remoteuser@remotehost:/remote/dir
- Note that the from and to will be switched around from the examples
- Note that local paths need to use cygwin style, like /cygdrive/d/somefolder/ or /util/cwrsync/doc/
6) When the directions in step 5 have gotten you to the point where the following command works: rsync -az -e "c:\Util\cwRsync\bin\ssh -i my-rsync-key" /my/local/path/ remoteuser@remote.host.com:remote/path/
Then, save that command to a batch file (e.g. c:\util\cwrsync\bin\sync.bat), like so:
@echo off
echo .
echo .
echo .
echo Found new pictures to synchronize with xa44.com
echo .
echo .
echo SYNCHRONIZING...
c:\Util\cwRSync\bin\rsync -az -e "c:\Util\cwRsync\bin\ssh -i my-rsync-key" /my/local/path/ remoteuser@remote.host.com:remote/path/
echo .
echo Done.
8) Add the AutoIt script to your startup items, and now you have a tray icon watching the folder every 5 minutes for any change in the number of files or bytes, which will launch rsync over ssh if it finds any changes.
Ramius on
0
RamiusJoined: July 19, 2000Administrator, ClubPAadmin
edited September 2008
if anyone is interested, I actually tweaked the rsync params a bit to get something more suitable for my purposes:
c:\Util\cwRSync\bin\rsync -rtz --chmod=Du+rwx,Dgo+rx,Fu+rw,Fgo+r --delete -e "c:\Util\cwRsync\bin\ssh -i my-rsync-key" /my/local/path/ remoteuser@remote.host.com:remote/path/
Posts
but that's before I found out about the FileSystemWatcher class. Link with sample script.
http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx
So thanks for the idea, but I'd rather just download+install something if it exists (which it should, in any sensible world).
Luckily since I'm unemployed and waiting on pizza, I did have the time to dig this up:
http://www.deventerprise.net/Projects.aspx
Disclaimer - I have never used this or heard of this guy before.
In the end, I got it working like this:
1) download the cwRsync installer from here (homepage)
2) install to c:\util\cwRsync
3) download AutoIt3 from here
4) install to c:\util\AutoIt3
5) Open a command prompt, situate yourself in the c:\util\CwRsync\bin directory, and then loosely follow these directions.
- Note that if you have some other 'ssh' in your path, you should use the absolute path to the cwrsync, like so: rsync -avz -e "c:\util\cwrsync\bin\ssh" /this/dir/ remoteuser@remotehost:/remote/dir
- Note that the from and to will be switched around from the examples
- Note that local paths need to use cygwin style, like /cygdrive/d/somefolder/ or /util/cwrsync/doc/
6) When the directions in step 5 have gotten you to the point where the following command works: rsync -az -e "c:\Util\cwRsync\bin\ssh -i my-rsync-key" /my/local/path/ remoteuser@remote.host.com:remote/path/
7) Create an AutoIt script, like so:
8) Add the AutoIt script to your startup items, and now you have a tray icon watching the folder every 5 minutes for any change in the number of files or bytes, which will launch rsync over ssh if it finds any changes.
c:\Util\cwRSync\bin\rsync -rtz --chmod=Du+rwx,Dgo+rx,Fu+rw,Fgo+r --delete -e "c:\Util\cwRsync\bin\ssh -i my-rsync-key" /my/local/path/ remoteuser@remote.host.com:remote/path/
Windows Live FolderShare
http://www.foldershare.com