Coder Social home page Coder Social logo

filesyncdaemon's Introduction

FileSyncDaemon

Linux daemon which synchronize two directories (source and destination) Support recursive mode, so all files and subdirectories are synchronized too. All actions made by daemon are logged and accessible in /var/log/syslog

Example logs view image

Usage

Usage: ./daemon sourcePath destinationPath [-d|--debug] [-R|--recursive] [-s=<sleep_time>|--sleep_time=<sleep_time>] [-B=<size_mb>|--big-file-size=<size_mb>]

Arguments:
    sourcePath        The path to the source directory.
    destinationPath   The path to the destination directory.

Options:
    -d, --debug              Enable debug mode.
    -R, --recursive          Synchronize directories recursively.
    -s, --sleep_time         The time in seconds to sleep between iterations. Default value is 10.
    -B:5, --big-file-size:5  Fize size when daemon will use mapping file

Example usage:
    ./Demon /home/user/source /home/user/backup -R -s=5

Useful commands

ps aux | grep Demon | grep -v grep | grep -v /bin/bash | awk '{print $2}' | while read pid; do kill -s SIGUSR1 $pid; done

command to send signal to daemon

head -c 5MB /dev/zero > ostechnix.txt

command to create 5MB file

sudo service rsyslog start

in WSL we must enable rsyslog service manually to see logs in /var/log/syslog

tail -5 /var/log/syslog

display last 5 system logs

Installation

  1. Clone the repo
    git clone https://github.com/Kaspek2480/FileSyncDemon
    cd FileSyncDemon
  2. Build the application
    mkdir build
    cmake -DCMAKE_BUILD_TYPE=Release -S . -B build
    cmake --build build
  3. Add executable permissions
    chmod +x Daemon

filesyncdaemon's People

Contributors

kaspek2480 avatar jaroslawx avatar mrcinkrkwk1 avatar

Watchers

 avatar

filesyncdaemon's Issues

Start args

  • sprawdzenie liczby argumentow
  • weryfikacja czy takie ścieżki istnieją

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.