This is the folder that I developed before the automatic synchronization tool, the main implementation of the development Machine and server folder synchronization.
Project Address:
Problem description
Modify the code under Windows, compile it to the server, but always drag and drop it through the tools such as WINSCP (you can, of course, go through the SCP command line).
Each time you modify the file is very few, and may be in different directories, each time the operation of overwriting the file feels more troublesome, so developed this Automatic folder automatic synchronization tool.
Of course, this tool can also be used for folder synchronization between two Linux servers.
Tools Introduction
The principle of the tool is to monitor the local file state, according to the captured events trigger related actions, through the command operation to achieve folder synchronization.
Configuration file Description:
Host: Server address sshport: Server SSH Port User: username password: password localdir: folder to synchronize Remotedir: Sync to server folder fileexcept: unsynchronized files
Sample code configuration file:
<config>
Dependent libraries:
Paramiko:ssh Operation Library
Watchdog: Used to monitor local folder status
Can be installed by PIP mode, the command is as follows:
PIP Install PARAMIKOPIP install watchdog
Examples of tool use are:
$ python autosync.py default.xml
Discuss
1, if you want to share with a separate EXE file to a friend how to do?
Can be packaged as a separate binary file via Pyinstaller, with the following command: Pyinstaller.py-f autosync.py
EXE in the Autosync/dist directory
Pyinstaller Address:
All right, that's it, I hope it helps you.
This article GitHub address:
20170617_ Folder Auto-sync tool. RST
Welcome to Supplement