{"id":16660542,"url":"https://github.com/killme2008/clojure-control","last_synced_at":"2025-10-07T02:44:27.190Z","repository":{"id":62435352,"uuid":"2096082","full_name":"killme2008/clojure-control","owner":"killme2008","description":"Fabric in clojure","archived":false,"fork":false,"pushed_at":"2015-06-25T06:19:06.000Z","size":3686,"stargazers_count":135,"open_issues_count":8,"forks_count":10,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-08-10T11:36:21.068Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Clojure","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/killme2008.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}},"created_at":"2011-07-24T09:47:56.000Z","updated_at":"2025-03-13T04:05:21.000Z","dependencies_parsed_at":"2022-11-01T21:02:36.276Z","dependency_job_id":null,"html_url":"https://github.com/killme2008/clojure-control","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/killme2008/clojure-control","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/killme2008%2Fclojure-control","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/killme2008%2Fclojure-control/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/killme2008%2Fclojure-control/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/killme2008%2Fclojure-control/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/killme2008","download_url":"https://codeload.github.com/killme2008/clojure-control/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/killme2008%2Fclojure-control/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272942401,"owners_count":25019329,"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","status":"online","status_checked_at":"2025-08-31T02:00:09.071Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-10-12T10:29:42.460Z","updated_at":"2025-10-07T02:44:22.171Z","avatar_url":"https://github.com/killme2008.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Introduction\n\nDefine clusters and tasks for system administration or code deployment, then execute them on one or many remote machines.\n\nClojure-control depends only on OpenSSH and clojure on the local control machine.Remote machines simply need a standard sshd daemon.\n\nThe idea came from [node-control](https://github.com/tsmith/node-control).\n\n##News\n\n * Control 0.4.1 released.[ReleaseNotes](https://groups.google.com/forum/?fromgroups#!topic/clojure/MLR_5VfenSs)\n\n## Installation\n\nClojure-Control bootstraps itself using the `control` shell script; there is no separate install script. It installs its dependencies upon the first run on unix, so the first run will take longer.\n\n* [Download the script.](https://raw.github.com/killme2008/clojure-control/master/bin/control)\n* Place it on your $PATH. (I like to use ~/bin)\n* Set it to be executable. (`chmod 755 ~/bin/control`)\n\nThe link above will get you the stable release. \n\nOn Windows most users can get the batch file. If you have wget.exe or curl.exe already installed and in PATH, you can just run `control self-install`, otherwise get the standalone jar from the downloads page. If you have Cygwin you should be able to use the shell script above rather than the batch file.\n\n## Basic Usage\n\nThe [tutorial](https://github.com/killme2008/clojure-control/wiki/Getting-started) has a detailed walk-through of the steps involved in creating a control project, but here are the commonly-used tasks:\n\n     control init                     #create a sample control file in current folder\n\t control run CLUSTER TASK \u003cargs\u003e  #run user-defined clojure-control tasks against certain cluster \n     control show CLUSTER             #show certain cluster info.\n\nUse `control help` to see a complete list.\n\n## Getting started\n\nCreating a control file by:\n    \n\tcontrol init\n\nIt will create a file named `control.clj` under current folder.Defines your clusters and tasks in this file,for example:\n\n```clj\n     (defcluster :default-cluster\n         :clients [\n                  {:host \"localhost\" :user \"root\"}\n         ])\n     (deftask :date \"echo date on cluster\"  []\n         (ssh \"date\"))\n```\n\nIt defines a cluster named `default-cluster`,and defines a task named `date` to execute `date` command on remote machines.Run `date` task on `default-cluster` by:\n\n    control run default-cluster date\n\nOutput:\n```\n    Performing default-cluster\n    Performing date for localhost\n    localhost:ssh:  date\n    localhost:stdout: Sun Jul 24 19:14:09 CST 2011\n    localhost:exit: 0\n```\nAlso,you can run the task with `user@host` instead of a pre-defined cluster:\n\t\t \n\t\t control run root@localhost date\n\nYou may have to type password when running this task. You can setup ssh public keys to avoid typing a password when logining remote machines.please visit [HOWTO: set up ssh keys](http://pkeck.myweb.uga.edu/ssh/)\n\nEvery task's running result is a map contains output and status,you can get them by:\n\n```clj\n     (let [rt (ssh \"date\")]\n       (println (:status rt))\n       (println (:stdout rt))\n       (println (:stderr rt)))\n```\n\n\nYou can do whatever you want with these values,for example,checking status is right or writing standard output to a file.\n\n##Some practical tasks\n\nA task to ping mysql:\n\n```clj\n\n\t(deftask :ping-mysql  []\n\t  (let [stdout (:stdout (ssh \"mysqladmin -u root  -p'password' ping\"))]\n\t      (if (.contains stdout \"is alive\")\n      \t  1\n\t\t  0)))\n```\n\nA task to deploy application:\n\n```clj\n    (deftask :deploy-app []\n          (local \"tar zcvf app.tar.gz app/\")\n          (scp \"app.tar.gz\" \"/home/user/\")\n          (ssh\n               (run \n                   (cd \"/home/user\"\n    \t\t\t\t   (run\n\t    \t\t\t      (run \"tar zxvf app.tar.gz\")\n       \t    \t\t\t  (env \"JAVA_OPTS\" \"-XMaxPermSize=128m\"\n                             (run \"bin/app.sh restart\")))))))\n```\n\nTwo tasks to install zookeeper c client:\n\n```clj\n     (deftask ldconfig\n\t   []\n\t     (ssh \"ldconfig\" :sudo true))\n\n\t (deftask install_zk_client\n\t  []\n\t      (ssh\n\t\t   (run\n\t\t       (run \"mkdir -p /home/deploy/dennis\")\n\t\t\t   (cd \"/home/deploy/dennis\"\n\t\t\t           (run \"wget http://labs.renren.com/apache-mirror//zookeeper/zookeeper-3.4.3/zookeeper-3.4.3.tar.gz\"))))\n\t     (ssh (cd \"/home/deploy/dennis\"\n\t            (run \"tar zxvf zookeeper-3.4.3.tar.gz\")))\n         (ssh (cd \"/home/deploy/dennis/zookeeper-3.4.3/src/c\"\n\t\t        (run\n\t\t              (run \"./configure --includedir=/usr/include\")\n\t\t              (run \"make\")\n\t\t              (run \"sudo make install\"))))\n\t\t  (call :ldconfig))\n```\n\n##Documents\n\n* [Getting started](https://github.com/killme2008/clojure-control/wiki/Getting-started)\n* [Define clusters](https://github.com/killme2008/clojure-control/wiki/Define-clusters)\n* [Define tasks](https://github.com/killme2008/clojure-control/wiki/Define-tasks)\n* [DSL commands](https://github.com/killme2008/clojure-control/wiki/commands)\n* [Clojure-Control shell commands](https://github.com/killme2008/clojure-control/wiki/Control-shell-commands)\n* [API document](http://fnil.net/clojure-control/)\n\n\n* [Wiki](https://github.com/killme2008/clojure-control/wiki)\n\n## Contributors\n\n[sunng87](https://github.com/sunng87)  \n\n[onycloud](https://github.com/onycloud/) \n\n[ljos](https://github.com/ljos)\n\n[dhilipsiva](https://github.com/dhilipsiva)\n\n##License\n\nMIT licensed\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkillme2008%2Fclojure-control","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkillme2008%2Fclojure-control","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkillme2008%2Fclojure-control/lists"}