Coder Social home page Coder Social logo

ahmetozer / mirrorfy Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 145 KB

Mirrorfy is a rsync control script. It listens to your project directory and uploads your projects to your server for every change. One way sync system.

Home Page: https://ahmetozer.org/Push-files-to-server-every-change-Alternative-use-samba-or-ftp-to-realtime-sync.html

License: MIT License

Shell 98.74% Dockerfile 1.26%
sync synchronization file-sharing linux rsync rsync-backup bash

mirrorfy's Introduction

mirrorfy

This project created for manage rsync directories. It's upload files to server every change.

install

Currently Supports most of the linux computers, WSL1
Tested on WSL1 Ubuntu and Debian.

Currently WSL2 not supported.

sudo curl https://mirrorfy.ahmetozer.org/mirrorfy -o /usr/bin/mirrorfy
sudo chmod +x /usr/bin/mirrorfy

install dependencies

# For ubuntu or Ubuntu on WSL
sudo apt install inotify-tools openssh rsync screen

Commands

start

mirrorfy start Start mirrorfy daemon.
It watchs your directories and every change uploads your directory to remote location.

run

mirrorfy run Run your mirrorfy only once.
Upload all mirrorfy directories to remote servers.

list

mirrorfy list List your all directories in config.

add

mirrorfy add Add locations to mirrorfy config list. This functions has a some flags. Some ones required and showed with bold.

  • -n
    Config name.
    Ex. mirrorfy add -n project1
  • -a
    Remote server address. You can also define custom user. Ex. mirrorfy add -a 1.1.1.1 mirrorfy add -a [email protected]
  • -d
    Remote server directory
    Ex. mirrorfy add -d /my/remote/directory
  • -l
    Local directory. If it is not defined, program will be select current working directory.
    Ex. mirrorfy add -l /my/sync/dir
  • -p
    Custom ssh port. Normally ssh uses port number 22 but if you changed to another port, you have to inform about to program with -p flag.
    Ex. mirrorfy add -p 422
  • -r
    Custom rsync arguments. Mirrorfy is uses "-avzhp --delete" arguments for rsync, but if you want to use custom arguments you can define with -r flag. Note: Do not forget to use " while writing rsync arguments.
    Ex. mirrorfy add -r "-avzhp"

Example Commands

mirrorfy add -n myproject1 -a mirrorfy.ahmetozer.org -d /my/remote/dir
mirrorfy add -n myproject1 -a [email protected] -d /my/remote/dir -p 68
mirrorfy add -n myproject1 -a [email protected] -d /my/remote/dir -l /my/local/dir/
mirrorfy add -n myproject1 -a mirrorfy.ahmetozer.org -d /my/remote/dir -p 99 -l /my/local/directory/

service

mirrorfy service You can control mirrorfy service on your linux or windows machine

  • start
    Start mirrorfy service
  • stop
    Stop mirrorfy service
  • restart
    Restart mirrorfy service
  • register
    Add mirrorfy to startup in linux or Create task in Windows
  • unregister
    Delete mirrorfy at startup in linux or Delete task in Windows

Add startup

Linux

Run mirrorfy service register to add mirrorfy startup folder.

Windows

Run cmd as Administrator and enter to WSL enviroment with wsl command, then execute mirrorfy service register command to register Mirrorfy service on windows.


Note: You have to create SSH keys on your pc and upload this keys to your server. After uploading ssh key, Please make test connection to your server before adding mirrorfy. You can found more information to creating ssh key and upload, Please visit ahmetozer.org

mirrorfy's People

Contributors

ahmetozer avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

mirrorfy's Issues

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.