{"id":15873920,"url":"https://github.com/wavejumper/seed","last_synced_at":"2025-04-01T22:43:44.617Z","repository":{"id":69562670,"uuid":"372118956","full_name":"wavejumper/seed","owner":"wavejumper","description":null,"archived":false,"fork":false,"pushed_at":"2021-05-30T04:15:07.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-07T14:46:41.863Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wavejumper.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-30T03:59:51.000Z","updated_at":"2021-05-30T04:15:09.000Z","dependencies_parsed_at":"2023-02-24T16:30:41.847Z","dependency_job_id":null,"html_url":"https://github.com/wavejumper/seed","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"fb28bd7d739f05cebe3fec40880de916fbf08a4b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavejumper%2Fseed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavejumper%2Fseed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavejumper%2Fseed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavejumper%2Fseed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wavejumper","download_url":"https://codeload.github.com/wavejumper/seed/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246724796,"owners_count":20823543,"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-06T01:08:37.408Z","updated_at":"2025-04-01T22:43:44.572Z","avatar_url":"https://github.com/wavejumper.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# seed\n\nseed is designed to sync a remote host's directory with a local directory based on some filters.\n\nFor example: syncing all `.flac` and `.mp3` files on a remote host to a local `~/music` dir and all `.mkv` files to a `~/movies` dir.\n\nAfter files have been transferred to a local directory, arbitrary hooks can also be configured.\n\nseed is configured using EDN.\n\nseed currently only supports the sFTP protocol for sources.\n\n## Getting started\n\n```bash\ngit clone git@github.com:wavejumper/seed.git\nlein uberjar\njava -jar target/seed.jar config.edn\n```\n\n## Example configuration\n\n```clojure\n{:sftp/pool                    {:host        \"xxx.foo.cz\"\n                                :username    \"foo\"\n                                :known-hosts \"~/known_hosts\"\n                                :password    \"zzzzzz\"\n                                :n-conns     20}\n\n :sftp/source                  {:pool    #ig/ref :sftp/pool\n                                :dir     \"/media/files\"\n                                :poll-ms 60000\n                                :depth   3\n                                :targets #ig/refset :sftp/target}\n\n [:source/music :sftp/target]  {:dir     \"/Media/music\"\n                                :filters [[:some-ext #{\".flac\" \".mp3\"}]]}\n\n [:source/movies :sftp/target] {:dir     \"/Media/movies\"\n                                :filters [[:some-ext #{\".mkv\"}]]}}\n```\n\nRead through the next section for an explanation of the available components.\n\n## Components\n\nConfiguration is defined as an EDN file, which is just an [integrant config map](https://github.com/weavejester/integrant)\n\nThis section documents the available integrant components and ways they can be [composed](https://github.com/weavejester/integrant#composite-keys) together\n\n### :sftp/pool\n\nDefines a `com.jcraft.jsch.JSch` connection pool:\n\n* `username` - username for session\n* `password` - password for session\n* `port` - port for connection (default : 22)\n* `host` - the host for connection\n* `known-hosts` - path to known_hosts file, default `~/.ssh/known_hosts`\n* `n-conns` - the number of connections in the pool (default: 5)\n\n#### Notes on known-hosts\n\nJSch prefers a known_hosts file in the RSA format. \n\nIf JSch fails to read `~/.ssh/known-hosts`, you can create a known_hosts file using the RSA format like so:\n\n```bash \nssh-keyscan -H -t rsa example.org \u003e\u003e known_hosts\n```\n\n### :sftp/source\n\nA source polls for new files from a remote host at a specified interval:\n\n* `client` - a reference to the `:sftp/client` component\n* `dir` - the remote directory to poll for files\n* `depth` - the depth in which to scan for files (default: 1)\n* `poll-ms` - how often in milliseconds to poll for new files\n* `targets` -  a collection of `:sftp/target`\n* `cache` - the location of the cache file to be generated (default: `cache.edn`)\n\n### :sftp/target\n\nA target is a local directory that is the destination for new files to be copied from a source.\n\nA target contains a collection of filters. If a new file from the source matches every filter, it will be copied to the target destination.\n\n* `dir` - the local directory\n* `filters` - a collection of filters. A filter is a tuple of `[:id \u0026 args]`\n\n#### Custom filters\n\nYou can add your own custom filters by extending the `seed.core/filter-fn` multimethod.\n\nFor example, `:some-ext` is implemented as:\n\n```clojure \n(defmethod filter-fn :some-ext\n  [[_ exts]]\n  (fn [{:keys [filename]}]\n    (some #(str/ends-with? filename %) exts)))\n```\n\n## License\n\nCopyright © 2021\n\nThis program and the accompanying materials are made available under the\nterms of the Eclipse Public License 2.0 which is available at\nhttp://www.eclipse.org/legal/epl-2.0.\n\nThis Source Code may also be made available under the following Secondary\nLicenses when the conditions for such availability set forth in the Eclipse\nPublic License, v. 2.0 are satisfied: GNU General Public License as published by\nthe Free Software Foundation, either version 2 of the License, or (at your\noption) any later version, with the GNU Classpath Exception which is available\nat https://www.gnu.org/software/classpath/license.html.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwavejumper%2Fseed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwavejumper%2Fseed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwavejumper%2Fseed/lists"}