{"id":18245649,"url":"https://github.com/totekuh/ssh-sync","last_synced_at":"2025-06-18T17:37:48.944Z","repository":{"id":178470090,"uuid":"633363935","full_name":"totekuh/ssh-sync","owner":"totekuh","description":"SSH Sync Folders is a simple and Bash script for syncing a local directory with a remote directory over SSH using rsync and inotifywait. The script monitors the local directory for changes and automatically syncs the updated files to the remote directory.","archived":false,"fork":false,"pushed_at":"2023-07-03T23:50:07.000Z","size":6,"stargazers_count":8,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T17:15:27.087Z","etag":null,"topics":["bash","makefile","rsync","ssh","sshpass","sync","syncronization"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/totekuh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2023-04-27T10:40:55.000Z","updated_at":"2025-02-06T18:36:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"600dbf4f-f782-46d0-8f7b-2eb8faa9df67","html_url":"https://github.com/totekuh/ssh-sync","commit_stats":null,"previous_names":["totekuh/ssh-sync"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/totekuh/ssh-sync","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/totekuh%2Fssh-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/totekuh%2Fssh-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/totekuh%2Fssh-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/totekuh%2Fssh-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/totekuh","download_url":"https://codeload.github.com/totekuh/ssh-sync/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/totekuh%2Fssh-sync/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260600265,"owners_count":23034678,"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":["bash","makefile","rsync","ssh","sshpass","sync","syncronization"],"created_at":"2024-11-05T09:22:07.049Z","updated_at":"2025-06-18T17:37:43.934Z","avatar_url":"https://github.com/totekuh.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Description\n\nA simple Bash script to sync a local directory with a remote directory over SSH using rsync and inotifywait. \n\nThe script sets up file watches on the local directory and automatically syncs any changes to the remote directory. \nIf the initial sync fails due to permission issues or other errors, the script will not set up watches and will exit.\n\n## Usage\n\n```bash\nssh-sync-folders [OPTIONS]\n```\n\n### Options\n\n- `-l`, --local-dir=DIR: Local directory to be synced (default: current directory)\n- `-u`, --remote-user=USER: Remote SSH user\n- `-p`, --remote-pass=PASSWORD: Remote SSH password (optional)\n- `-h`, --remote-host=HOST: Remote SSH host\n- `-d`, --remote-dir=DIR: Remote directory to sync to (default: /shared)\n- `-e`, --exclude=PATTERNS: Comma-separated list of file/folder patterns to exclude\n\nTo display the help message, run the script with the `--help` option:\n\n```bash\nssh-sync-folders --help\n```\n\nYou can configure the script using environment variables or command-line options. Command-line options take precedence over environment variables.\n\nConfigure the following environment variables before running the script, unless you provide the options via command-line arguments:\n\n\n- `SSH_SYNC_LOCAL_DIR`: Local directory to be synced\n- `SSH_SYNC_REMOTE_USER`: Remote SSH user\n- `SSH_SYNC_REMOTE_PASS`: Remote SSH password (optional if using RSA keys)\n- `SSH_SYNC_REMOTE_HOST`: Remote SSH host\n- `SSH_SYNC_REMOTE_DIR`: Remote directory to sync to\n- `SSH_SYNC_EXCLUDE_PATTERNS`: Comma-separated list of file/folder patterns to exclude\n\n## Dependencies\n\n- `rsync`\n- `inotify-tools`\n- `sshpass` (optional, required if using a remote password)\n\n## Installation\n\nA Makefile is included for easy installation and uninstallation. \n\nTo install the script, simply run:\n\n```bash\nmake install\n```\n\nThis will copy the script to `/usr/bin` and make it executable. \n\nTo uninstall the script, run:\n\n```bash\nmake uninstall\n```\n\nTo configure environment variables, run:\n\n```bash\nmake configure\n```\n\n## Example\n\n```bash\nssh-sync-folders -l /path/to/local/dir -u remote_user -h remote_host -d /path/to/remote/dir -e \".git,*.log\"\n```\n\nThis command will sync `/path/to/local/dir` to `/path/to/remote/dir` on the remote host, excluding any `.git` directories and `*.log` files. \nThe local directory will be watched for changes, and any modifications will be synced to the remote directory automatically.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftotekuh%2Fssh-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftotekuh%2Fssh-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftotekuh%2Fssh-sync/lists"}