{"id":24483150,"url":"https://github.com/sukiboo/not_dropbox","last_synced_at":"2026-04-28T09:32:10.974Z","repository":{"id":197787654,"uuid":"699326673","full_name":"sukiboo/not_dropbox","owner":"sukiboo","description":"Sync a directory to a remote machine over ssh via rsync","archived":false,"fork":false,"pushed_at":"2023-10-19T12:23:37.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-03T01:05:01.533Z","etag":null,"topics":["bash","crontab","rsync","ssh","synchronization"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"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/sukiboo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-02T12:17:11.000Z","updated_at":"2023-10-08T19:14:45.000Z","dependencies_parsed_at":"2023-10-15T16:56:31.021Z","dependency_job_id":null,"html_url":"https://github.com/sukiboo/not_dropbox","commit_stats":null,"previous_names":["sukiboo/not_dropbox"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sukiboo/not_dropbox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sukiboo%2Fnot_dropbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sukiboo%2Fnot_dropbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sukiboo%2Fnot_dropbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sukiboo%2Fnot_dropbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sukiboo","download_url":"https://codeload.github.com/sukiboo/not_dropbox/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sukiboo%2Fnot_dropbox/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32375323,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T09:24:15.638Z","status":"ssl_error","status_checked_at":"2026-04-28T09:24:15.071Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","crontab","rsync","ssh","synchronization"],"created_at":"2025-01-21T12:31:05.134Z","updated_at":"2026-04-28T09:32:10.943Z","avatar_url":"https://github.com/sukiboo.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Not Dropbox\nA simple bash script that uses `rsync` and `sshpass` to sync files between two directories if the conventional tools like Dropbox, Google Drive, OneDrive are not available.\nThis script allows directory syncronization between two machines: `SERVER` and `CLIENT`, and can be used for manual or automated two-way file backups.\n\n\n## Setup\nBoth `SERVER` and `CLIENT` machines must have `ssh`, `sshpass`, and `rsync` installed, which they likely already have.\n\nThe script expects the following shell variables, defined in `./config`:\n- `SSHPASS_PATH` -- path to `sshpass` on `SERVER`, probably `/usr/local/bin/sshpass`\n- `RSYNC_PATH` -- path to `rsync` on `SERVER`, probably `/usr/bin/rsync`\n- `SERVER_DIR` -- path to the sync directory on `SERVER`\n- `CLIENT_DIR` -- path to the sync directory on `CLIENT`\n- `CLIENT_IP` -- ip address of `CLIENT`, must be in the local network\n- `CLIENT_PASS` -- password required to ssh to `CLIENT` (if any)\n\nHow/where the `config` file is stored is up to your security/convenience prefernces, but keep in mind that any program that has access to `config` essentially has access to the `CLIENT` machine.\nSince my `CLIENT` is a toaster that does not store any sensitive info, I just keep `config` in the script directory, but this is generally frowned upon.\n\n\n## How It Works\nThe script is run on the `SERVER` machine and its execution consists of three action:\n1. pull new files from `CLIENT` and replace the modified ones\n2. remove files on `SERVER` marked for deletion with `~`\n3. push files to `CLIENT` and delete the files that are not on `SERVER`\n\nThat way each machine is able to add/modify/remove files.\n\n#### Adding Files\nTo add new files, just put them in the sync directory on either `SERVER` or `CLIENT` machine.\nNew and modified files will be synced during the next script execution.\nAny modified file will replace its original version; in case of conflict, the most recent version will be saved.\n\n#### Removing Files\nDeleting files is a bit more nuanced since just deleting will not work -- as long as a file exists on either `SERVER` or `CLIENT` machine, it will be copied to both.\nIn order to be removed, the files/directories must be manually marked for deletion by appending `~` to the file name, i.e.\n```\nfile_to_remove.ext -\u003e file_to_remove~.ext\ndir_to_remove -\u003e dir_to_remove~\n```\nFiles/directories marked with a trailing tilde will be delete from both `SERVER` or `CLIENT` during the next script execution.\n\nSuch a way of deletion fits the backup needs as it greatly reduces the chance of files being delete by accident.\nHowever, if a more conventional deletion is preferred, one can look into [rsync-continuous repo](https://github.com/mikkorantalainen/rsync-continuous).\n\n\n## How to Run\nOnce the script is set up, you can run it manually when the syncronization is needed or bind it to a shortcut.\\\nAlternatively, if you require a more persistent syncronization, set up a `cron job`.\n\nFor instance, I run it every 5 minutes in `crontab` via\n```bash\n*/5 * * * * cd /path/to/script/ \u0026\u0026 bash script.sh \u003e\u003e logs\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsukiboo%2Fnot_dropbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsukiboo%2Fnot_dropbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsukiboo%2Fnot_dropbox/lists"}