Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Project structure:

folder_sync/
│
├── logs/
├── src/
│   ├── test/
│   │   ├── replica/
│   │   └── source/
│   │   
│   ├── settings.ini
│   ├── sync.py
│   └── utils.py
│
├── Makefile
├── README.md
└── requirements.txt

src/sync.py:

  • Contains the main logic of the program.

src/utils.py:

  • This module contains helper functions, such as the function of creating an address if it does not exist, etc.

src/settings.ini:

  • This file contains the default settings for the program.

src/test/replica | source:

  • These directories are used for testing purposes.

Libraries used:

  • argparse
  • os
  • shutil
  • argparse
  • asyncio
  • filecmp
  • hashlib
  • inspect
  • logging
  • sys
  • colorlog
  • configparser

How to run the program:

In src/settings.ini you can change the default settings of the program (in this case logging level).

There is Makefile in the root directory of the project. You can run the program by running the following command:

make help # To see the help message
make install # To install Venv and dependencies
make run # To run the program with default arguments
make run_sync # To run the program with default arguments
make run_ # To run the program with default arguments (in venv)
make run_sync_ # To run the program with default arguments (in venv)

Arguments:

  • --sync: To enable automatically sync the source and replica directories. (default is True)
  • --interval: The interval in seconds to check for changes in the source directory. (default is 1s)
  • --log: The path to the log file. (default is logs/{generated_timestamp}.log)
  • --replica: The path to the replica directory. (default is "src/test/replica")
  • --source: The path to the source directory. (default is "src/test/source")
  • --help: To see the help message.
python3 src/sync.py -sync --interval 1 --log logs/mylog.log --replica /path/to/replica --source /path/to/source

Author

Martin Fencl | martin@martinfencl.eu

About

This program is designed to synchronize folders between two locations: a source folder and a replica folder.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages