Переглянути джерело

Rename binary, add README.

Jakob Borg 13 роки тому
батько
коміт
167a0d0538
4 змінених файлів з 90 додано та 2 видалено
  1. 88 0
      README.md
  2. 1 1
      package.json
  3. 0 0
      zsnapper
  4. 1 1
      zsnapper.xml

+ 88 - 0
README.md

@@ -0,0 +1,88 @@
+      ____     ____    ___      __     _____   _____      __   _ __ 
+     /\_ ,`\  /',__\ /' _ `\  /'__`\  /\ '__`\/\ '__`\  /'__`\/\`'__\
+     \/_/  /_/\__, `\/\ \/\ \/\ \L\.\_\ \ \L\ \ \ \L\ \/\  __/\ \ \/
+       /\____\/\____/\ \_\ \_\ \__/.\_\\ \ ,__/\ \ ,__/\ \____\\ \_\
+       \/____/\/___/  \/_/\/_/\/__/\/_/ \ \ \/  \ \ \/  \/____/ \/_/
+                                         \ \_\   \ \_\
+                                          \/_/    \/_/
+
+This is a ZFS snapshotting service for Solaris, OpenIndiana, SmartOS and friends.
+
+Installation
+============
+
+Unpack
+------
+
+Clone this repository (or unpack the download) into `/opt/nym/zsnapper`. Any
+other directory will do as well, but you will need to modify the SMF manifest
+to update the paths.
+
+Install dependencies
+--------------------
+
+Run `npm install` in `/opt/nym/zsnapper`.
+
+Configure
+---------
+
+Update the config file `zsnapper` conf with your desired snapshot configuration.
+It's a JSON file of the format:
+
+    {
+        <dataset name>: {
+            <snapshot name>: {
+                "when": <cron string>,
+                "count": <number of snapshots>,
+                "exclude": [ <dataset to be excluded>, ... ]
+            },
+            <snapshot name>: {
+                "when": <cron string>,
+                "count": <number of snapshots>,
+                "exclude": [ <dataset to be excluded>, ... ]
+            }
+        },
+        <dataset name>: {
+            ...
+        }
+    }
+
+Where:
+
+  - *dataset name* is a name of a dataset to snapshot. Example: `zones`.
+
+  - *snapshot name* is a base to build snapshot names of. The current date and
+    time will be appended. Example: `daily` which will result in snapshot names
+    of the type `daily-20120515T1314900Z`.
+
+  - *cron string* is a cron-format description of when the snapshot should be
+    taken. `man 5 crontab` for details. Example: `15 0 * * 1` for snapshots at
+    00:15 the first of every month.
+
+  - *number of snapshots* is the number of snapshots that should be kept
+    historically before being destroyed.
+
+  - *exclude* is a list of dataset names (under the main *dataset name*) that
+    should not be snapshotted. Example: `[ "zones/swap", "zones/dump" ]`.
+
+Start
+-----
+
+To test the setup, start the service (as root) with the name of the config file
+as the only parameter.
+
+    # /opt/nym/zsnapper/zsnapper /opt/nym/zsnapper/zsnapper.json
+
+A better alternative, once everything seems to work as intended, is to use the
+accompanying SMF manifest. Edit `zsnapper.xml` to suit your installation
+(particularly the path to the `zsnapper` binary and `zsnapper.json` config
+file). Then import it:
+
+    # svccfg import zsnapper.xml
+
+The service should be started automatically, which you can verify:
+
+    # svcs site/zsnapper
+    STATE          STIME    FMRI
+    online         10:56:26 svc:/site/zsnapper:default
+

+ 1 - 1
package.json

@@ -5,7 +5,7 @@
     "keywords": ["solaris", "zfs", "illumos", "openindiana", "smartos"],
     "homepage": "http://nym.se/zsnapper/docs/",
     "version": "0.0.1",
-    "bin": "./server.js",
+    "bin": "./zsnapper",
     "scripts": {
         "test": "NODE_PATH=lib PATH=test:$PATH node_modules/.bin/mocha -R spec",
         "hint": "jshint *.js lib/*.js",

server.js → zsnapper


+ 1 - 1
zsnapper.xml

@@ -21,7 +21,7 @@
             <propval name="config_file" type="astring" value="/opt/nym/zsnapper/zsnapper.json"/>
         </property_group>
         
-        <exec_method type="method" name="start" exec="/opt/nym/zsnapper/server.js %{config_file}" timeout_seconds="60"/>
+        <exec_method type="method" name="start" exec="/opt/nym/zsnapper/zsnapper %{config_file}" timeout_seconds="60"/>
         <exec_method type="method" name="stop" exec=":kill" timeout_seconds="60"/>
 
         <stability value="Evolving"/>