{"id":16248551,"url":"https://github.com/pythonhacker/dirsync","last_synced_at":"2025-08-01T05:33:18.091Z","repository":{"id":25476542,"uuid":"28907238","full_name":"pythonhacker/dirsync","owner":"pythonhacker","description":"Directory syncer in Python. This is a github clone of the bitbucket repo at","archived":false,"fork":false,"pushed_at":"2015-01-07T09:50:56.000Z","size":218,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-11T14:42:07.883Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://bitbucket.org/tkhyn/dirsync","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pythonhacker.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-07T09:12:02.000Z","updated_at":"2022-09-29T20:02:57.000Z","dependencies_parsed_at":"2022-07-26T09:47:57.351Z","dependency_job_id":null,"html_url":"https://github.com/pythonhacker/dirsync","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pythonhacker%2Fdirsync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pythonhacker%2Fdirsync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pythonhacker%2Fdirsync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pythonhacker%2Fdirsync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pythonhacker","download_url":"https://codeload.github.com/pythonhacker/dirsync/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247839320,"owners_count":21004740,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T14:42:20.159Z","updated_at":"2025-04-08T12:23:58.779Z","avatar_url":"https://github.com/pythonhacker.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"dirsync\r\n=======\r\n\r\n|copyright| 2014 Thomas Khyn\r\n|copyright| 2003 Anand B Pillai\r\n\r\nAdvanced directory tree synchronisation tool\r\n\r\nbased on `Python robocopier`_ by Anand B Pillai\r\n\r\n\r\nUsage\r\n-----\r\n\r\nFrom the command line::\r\n\r\n   dirsync \u003csourcedir\u003e \u003ctargetdir\u003e [options]\r\n\r\nFrom python::\r\n\r\n   from dirsync import sync\r\n   sync(sourcedir, targetdir, action, **options)\r\n\r\n\r\nMain Options\r\n------------\r\n\r\nChosing one option among the following ones is mandatory\r\n\r\n--diff, -d              Only report difference between sourcedir and targetdir\r\n--sync, -s              Synchronize content between sourcedir and targetdir\r\n--update, -u            Update existing content between sourcedir and targetdir\r\n\r\nIf you use one of the above options (e.g. ``sync``) most of the time, you\r\nmay consider defining the ``action`` option in a `Configuration file`_ parsed\r\nby dirsync.\r\n\r\n\r\nAdditional Options\r\n------------------\r\n\r\n--verbose, -v           Provide verbose output\r\n--purge, -p             Purge files when synchronizing (does not purge by\r\n                        default)\r\n--force, -f             Force copying of files, by trying to change file\r\n                        permissions\r\n--nodirection, -n       Update files in source directory from target\r\n                        directory (only updates target from source by default)\r\n--create, -c            Create target directory if it does not exist (By\r\n                        default, target directory should exist.)\r\n--modtime, -m           Only compare file's modification times for an update\r\n                        (By default, compares source file's creation time\r\n                        also)\r\n--ignore, -x patterns   Regex patterns to ignore\r\n--only, -o patterns     Regex patterns to include (exclude every other)\r\n--exclude, -e patterns  Regex patterns to exclude\r\n--include, -i patterns  Regex patterns to include (with precedence over\r\n                        excludes)\r\n\r\n\r\nConfiguration file\r\n------------------\r\n\r\n.. note::\r\n   Configuration files are only used when using the command line, and ignored\r\n   when dirsync is called from within Python.\r\n\r\nIf you want to use predefined options all the time, or if you need specific\r\noptions when 'dirsyncing' a specific source directory, dirsync looks for\r\ntwo configuration files, by order or priority (the last takes precedence)::\r\n\r\n    %HOME%/.dirsync\r\n    source/directory/.dirsync\r\n\r\n.. warning::\r\n   Any ``source/directory/.dirsync`` file is automatically excluded from the\r\n   files to compare. You have to explicitly include using the ``--include``\r\n   option it if you want it to be covered by the comparison.\r\n\r\nThe command line options always override the values defined in the\r\nconfiguration files.\r\n\r\nThe configuration files must have a ``defaults`` section, and the options are\r\nas defined above. The only exception is for the option ``action``, which can\r\ntake 3 values ``diff``, ``sync`` or ``update``.\r\n\r\nExample config file::\r\n\r\n   [defaults]\r\n   action = sync\r\n   create = True\r\n\r\n\r\nCustom logger\r\n-------------\r\n\r\nFrom python, you may not want to have the output sent to ``stdout``. To do so,\r\nyou can simply pass your custom logger via the ``logger`` keyword argument of\r\nthe ``sync`` function::\r\n\r\n   sync(sourcedir, targetdir, action, logger=my_logger, **options)\r\n\r\n\r\n.. |copyright| unicode:: 0xA9\r\n\r\n.. _`Python robocopier`: http://code.activestate.com/recipes/231501-python-robocopier-advanced-directory-synchronizati/\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpythonhacker%2Fdirsync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpythonhacker%2Fdirsync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpythonhacker%2Fdirsync/lists"}