{"id":20678889,"url":"https://github.com/phpgt/sync","last_synced_at":"2025-04-19T23:45:18.001Z","repository":{"id":41398021,"uuid":"176249233","full_name":"phpgt/Sync","owner":"phpgt","description":"Synchronise two directories.","archived":false,"fork":false,"pushed_at":"2023-09-17T14:46:28.000Z","size":129,"stargazers_count":4,"open_issues_count":6,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-19T23:45:11.689Z","etag":null,"topics":["copy","copy-file-sync","copy-files","filesystem","recursive","rsync","sync","synchronisation","synchronise-data","synchronization","synchronize-files"],"latest_commit_sha":null,"homepage":"https://www.php.gt/sync","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phpgt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["phpgt"]}},"created_at":"2019-03-18T09:40:36.000Z","updated_at":"2025-03-29T18:30:53.000Z","dependencies_parsed_at":"2024-11-16T21:25:36.829Z","dependency_job_id":"3260daab-26a1-4557-b016-320d246d13b0","html_url":"https://github.com/phpgt/Sync","commit_stats":{"total_commits":52,"total_committers":1,"mean_commits":52.0,"dds":0.0,"last_synced_commit":"4760d5066af3dc09a10e2cc72307c9658252402f"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpgt%2FSync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpgt%2FSync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpgt%2FSync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpgt%2FSync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phpgt","download_url":"https://codeload.github.com/phpgt/Sync/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249830845,"owners_count":21331357,"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":["copy","copy-file-sync","copy-files","filesystem","recursive","rsync","sync","synchronisation","synchronise-data","synchronization","synchronize-files"],"created_at":"2024-11-16T21:22:58.102Z","updated_at":"2025-04-19T23:45:17.977Z","avatar_url":"https://github.com/phpgt.png","language":"PHP","funding_links":["https://github.com/sponsors/phpgt"],"categories":[],"sub_categories":[],"readme":"Synchronise two directories.\n============================\n\n`rsync` is the tool of choice for ensuring that two directories have the same content, but is only present by default on Unix systems. This repository provides simple recursive directory synchronisation in plain PHP, compatible on Linux, Mac and Windows.\n\n***\n\n\u003ca href=\"https://github.com/PhpGt/Sync/actions\" target=\"_blank\"\u003e\n\t\u003cimg src=\"https://badge.status.php.gt/sync-build.svg\" alt=\"Build status\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://app.codacy.com/gh/PhpGt/Sync\" target=\"_blank\"\u003e\n\t\u003cimg src=\"https://badge.status.php.gt/sync-quality.svg\" alt=\"Code quality\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://app.codecov.io/gh/PhpGt/Sync\" target=\"_blank\"\u003e\n\t\u003cimg src=\"https://badge.status.php.gt/sync-coverage.svg\" alt=\"Code coverage\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/PhpGt/Sync\" target=\"_blank\"\u003e\n\t\u003cimg src=\"https://badge.status.php.gt/sync-version.svg\" alt=\"Current version\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"http://www.php.gt/sync\" target=\"_blank\"\u003e\n\t\u003cimg src=\"https://badge.status.php.gt/sync-docs.svg\" alt=\"PHP.Gt/Sync documentation\" /\u003e\n\u003c/a\u003e\n\n## Example usage\n\n```php\n$source = \"/var/www/example.com\";\n$destination = \"/var/backup/example.com\";\n\ntry {\n\t$sync = new DirectorySync($source, $destination);\n\t$sync-\u003eexec(DirectorySync::COMPARE_FILEMTIME);\n}\ncatch(SyncException $exception) {\n\tfwrite(STDERR, \"Error performing sync: \" . $exception-\u003egetMessage());\n\texit(1);\n}\n\necho \"Sync complete!\" . PHP_EOL;\necho \"Changed: \" . count($sync-\u003egetCopiedFilesList());\necho \"Deleted: \" . count($sync-\u003egetDeletedFilesList());\necho \"Skipped: \" . count($sync-\u003egetSkippedFilesList());\n```\n\nFeatures\n--------\n\n+ Cross-platform compatible directory synchronisation (Linux, Windows, Mac).\n+ Selective sync through glob matches (only sync js files within script directory with `/script/**/*.js`).\n+ Get statistics of copied/deleted/skipped files after sync execution.\n+ Low memory footprint.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpgt%2Fsync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphpgt%2Fsync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpgt%2Fsync/lists"}