Package: micsync
MICSYNC - local discs synchronisation toolMicsync is a tool that provides easy management of data kept on the disc and its backup or backups.
It uses rsync for all file operations. Verbose option will show the exact rsync command used.micsync on PyPi:https://pypi.org/project/micsync/InstallationIf you are using pacman package manager (on Arch linux and derived systems), prefer installation with pacman over pip. If you install package with pip, pacman doesn't see it and it may lead to conflicts in future when installing or updating other packages.Using git and makepkg (for pacman users)gitclonehttps://github.com/micdmy/micsync.gitcdmicsync/archive-pkgbuild/<lastversion>/
makepkg-sirReplace<last version>with actual directory name.Learn more:git clonemakepkgUsing pipAs root:pip install micsyncLearn more:python - installing packagesUsing git and python-setuptoolsgitclonehttps://github.com/micdmy/micsync.gitcdmicsync/
./build.shcdoutput/offline-PKGBUILD/
tar-xzfmicsync*cdmicsync*/As root:pythonsetup.pyinstall--optimize=1Check if micsync was installed succesfullymicsync--versionHow to use itMicsync allows to configure WORKING and BACKUP locations.
Location is a directory in filesystem and all subdirectories and files it contains.There are two types of locations which serve different purposes:WORKING location - examples of useLocation on disc that's backup can be kept in BACKUP.Workplace from which some files/directories can be send to BACKUP.Temporary cache for some data needed at the moment, that are kept on BACKUP all the time (i.e. when BACKUP is on external hard disc).BACKUP location - examples of useCan be used as backup copy of things in WORKING location.Can be used as source of data for other BACKUPs (mirrors).Data from BACKUP can be copied back to WORKING, or even override or remove data there.BACKUP directories structure (tree, skeleton) can be copied (without files) to WORKING.Any number of WORKINGs can be linked with any number of BACKUPs.
One CONFIGURATION links together WORKINGs and BACKUPs.
WORKINGs and BACKUPs in one CONFIGURATION cannot overlap (i.e. WORKING contains BACKUP).There may be a lot of CONFIGURATIONs that don't influence each other.
User sets the CONFIGURATIONs up in ".micsync.json" file located in user's home directory.Example of .micsync.json file:{"configs":[{"name":"My first CONFIGURATION, it contains 1 WORKING and 1 BACKUP","work":["/home/example_user/some_dir/"],"backup":["/example/path/"]},{"name":"My second CONFIGURATION, it contains 2 WORKINGs and 3 BACKUPs","work":["/home/example_user/some_dir/","~/other/"],"backup":["/a/backup/","./it/may/be/relative/path/","~/my/third/backup/"]}]}Command line interfaceCommand syntaxmicsync<sync-action>[options]<paths>micsync<other-action><sync-action>tells micsync what kind of the synchronization operation should be performed between locations.
Currently, there are 4 synchronization actions defined:--backup--work--transfer--tree<other-action>are actions that don't perform any operations on files in defined locations:--version- prints the program version[options]are specific for each action.
They are used, for example, to define what micsync do with modified files or if it can delete files.<paths>is a path or space-separated list of paths to directories or files that exist within some of defined configurations.
All of the given paths must be within defined configurations.It doesn't matter if a path is in WORKING or BACKUP location. It doesn't influence the direction of copying.
You can tell micsync to, for example, do--backupoperation, specifying path in BACKUP or in WORKING. In each case, copying from WORKING to BACKUP will be performed. The direction is defined by<sync-action>, not by<paths>.Synchronization actions--backupCopies files and directories in<paths>from WORKING to all accessible BACKUPs.Asks which WORKING to choose if many are accessible.It never deletes anything in BACKUP. Lists new.Lists modified and asks for confirmation.Options:-m -s -vSource: WORKINGDestination: all accessible BACKUPS--workCopies files and directories in<paths>from chosen BACKUP to chosen WORKING.Asks which WORKING and/or BACKUP to choose if many are accessible.Lists to-delete and asks for confirmation.Lists modified and asks for confirmation.Options:-m -d -D -s -vSource: WORKINGDestination: BACKUP--transferCopies files and directories from chosen src BACKUP to chosen dst BACKUP.Asks to confirm or choose destination and source BACKUPS.Lists to-delete and asks for confirmation.(Only if -d ? - TODO: check it)Lists modified and asks for confirmation.Options:-m -d -D -s -vSource: BACKUPDestination: BACKUP--treeCopy directories empty structure from backup to work and/or update existing.Options:-s -vSource: BACKUPDestination: WORKINGOptions for synchronization actionsCopying options:-mCopy modified (overwrite) without asking.-dDelete files in dst if they don't exist in src. Ask before deleting.-DDelete files in dst if they don't exist in src. Don't ask before deleting. If-dand-Dspecified, works as if only-Dwas specified.User interface and verbosity options:-sSuppress information about modifying directories.-vVerbose mode. Shows rsync command used to perform synchronization. Asks before doing anything.Bug reportingHave you found a bug? Please, report ithere.Information for developersIf you are a developer and want to contribute to micsync, you're welcomed!
Don't hesitate to contact the author if you have questions.Required software:linux operating systemrsyncpacmanpython >= 3.7python-pippython-pytestpython-wheeltwinegitGetting source codegit clone https://github.com/micdmy/micsync.gitWorkflow - development and testing on local machineMake the changes.Run./build.shand see if there are any errors in output.Enter the directory with package for local (offline) installation:cd output/offline-PKGBUILD/Install with makepkg:makepkg -sirRun tests from main repository directory. See:tests/README.md.Do some manual tests.Commit/push changes.Workflow - releasing versionYou're ready with 'development and testing on local machine'.Change version number in filemicsync/version.py.Clean previous build artifacts with./clean.sh.Run./build.sh. You will be warned that git tag is not updated. Ignore it, pressyand enter. See if there are any errors in output.Run./deploy-pip.sh.output/dist/micsync-0.0.4.dev0-py3-none-any.whlandoutput/dist/micsync-0.0.4.dev0.tar.gzwill be sent tohttps://pypi.org/project/micsync/. You will be asked for credentials.Run./deploy-aur.sh. PKGBUILD file will be added toarchive-pkgbuild/<new version>/.Stagearchive-pkgbuild/andmicsync/version.py.Commit, add tag<new version>and push with tags.Workflow - testing released versionUninstall old version of micsync with pacman or pip.Install new version with pip. Run automatic tests. Make manual tests. Uninstall micsync.Install new version with pacman or makepkg. Run automatic tests. Make manual tests.Project organizationDirectory / FileIn git repoPurpose./micsync/Yes.Source code../micsync/version.pyYesContains version and program name. Version from this file is taken as program version bybuild.sh.tests/Yes.Automatic tests source code../archive-pk-pkgbuild/Yes.Storage for PKGBUILD files for every version../output/No.After build, contains all build artifacts. Removed withclean.sh./output/offline-PKGBUILD/No.After build, contains the packaged program and specially prepared PKGBUILD file for local (offline) installation../build.shYes.Script that builds the program../clean.shYes.Script that cleans the build artifacts../deploy-aur.shYesScript that copiesoutput/PKGBUILDtoarchive-pkgbuild/<new version>/../deploy-pip.shYesScript that sends new version to PyPi/micsync../micsync/version.pyYesContains version and program name. Version from this file is taken as program version bybuild.sh