Git Product home page Git Product logo

amply's Introduction

Amply

Simplistic pure-Python utility designed to make replication of directories easier.

Basically, given the source directory and list of target directories, it will

  • copy the contents of the source directory to all the target directories, excluding identical files and directories

  • remove the rest of files in target directories to synchronize them with the source directory if the -r/--remove-extra argument is provided

If you're only interested in seeing the difference, use -l/--list.

Dependencies

Just Python 3.5 or newer.

Configuration

You may provide the directories in a configuration file or as command-line arguments.

Note that it's only possible to provide one set of source and target directories as command-line arguments. See the -h/--help message for more information.

This utility was designed to be run from a package (hence the __main__.py file), like a ZIP file or a directory, but you can also run the file directly. The script will first try to parse the command line arguments. If the targets are present, it will treat the first argument as a path to the source directory; otherwise it will be treated as a path to the configuration file. If that fails, it will try to load config.json from the directory/ZIP file containing the script.

This means that a directory/ZIP file having both __main__.py and config.json files is a self-sufficient runnable package.

Sample configuration file

{
    "music": {
        "source": "/disk0/music",
        "targets": ["/disk1/music_backup"]
    },
    "images": {
        "source": "/disk0/pics",
        "targets": ["//share/pictures_store",  "/disk1/images_backup"]
    }
}

amply's People

Contributors

vaultah avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.