Folder Auto-sync Tool

Source: Internet
Author: User
Tags scp command ssh port
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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.