From Wikipedia:
rsync is a utility software and network protocol for Unix-like systems (with ports to Windows) that synchronizes files and directories from one location to another while minimizingdata transfer by using delta encoding when appropriate. Quoting the official website: "rsync is a file transfer program for Unix systems. rsync uses the 'rsync algorithm' which provides a very fast method for bringing remote files into sync."[3] An important feature of rsync not found in most similar programs/protocols is that the mirroring takes place with only one transmission in each direction. rsync can copy or display directory contents and copy files, optionally using compression and recursion.
FloWorks Laptops utilize CYGWIN, a linux command line utility for Windows. This allows the laptops to utilize linux libraries and utilities, including RSync.
Updating the operational data (parts list, unit list, mechanics list) to the field clients is done via the "rsyncData.py" script located on OKCPUB01. This script gathers the latest data from the OKCSQL01 database and creates XML files located in C:\Scripts\data on OKCPUB01. The script then calls "rsync.sh", which executes a rsync command to push the XML files contained in the C:\Scripts\data folder to a designated Amazon EC2 instance (54.243.106.29). This is run periodically via the Windows Task Scheduler.
The laptops use the following rsync command:
rsync -azhv --delete -e "ssh -i /cygdrive/c/.ssh/Flogistix.pem" ec2-user@54.243.106.29:/var/www/html/client/Floworks/ /cygdrive/c/floworks/
This executes a rync pull from the designated Amazon EC2 instance (54.243.106.29) to the specified destination (/cygdrive/c/floworks/) via SSH while utilizing the rsync compression (-z) and destination file deletion (--delete) options to ensure the clients stay up to date.
This command is contained with the "rsync.sh" file located in C:\FloWorks\. This shell script is executed initially upon login by listen.py, and then executed on a specified time interval by command.py (currently 300 seconds, or 5 minutes).
Prior to Version 2.2, FloWorks utilized a Git utility (via GitHub) as a syncing mechanism for source code and operational data. The process of migrating an existing field client laptop from Git to Rsync is as follows:
1. Open Internet Explorer and browse to www.floworks.net/rsync.zip. Click “Save as” and put the zip file in the C:\Down folder 45.9MB
Note: this will do an initial sync, file comparison, bring down the new listen.py and command.py as well as delete files not needed anymore. ~ 30 seconds
2. Move cygwin folder in zip to C:\
3. Move icon to desktop
4. move .ssh folder in zip to C:\
5. Move rsync.sh in zip to C:\FloWorks\
6. Open cygwin bash and run:
bash --login -i /cygdrive/c/floworks/rsync.sh