]> Sergey Matveev's repositories - glocate.git/blobdiff - USAGE
Slightly refactored documentation
[glocate.git] / USAGE
diff --git a/USAGE b/USAGE
new file mode 100644 (file)
index 0000000..fb9e732
--- /dev/null
+++ b/USAGE
@@ -0,0 +1,47 @@
+It is advisable to create a ZFS snapshot, to be sure that there are some
+checkpoint state:
+
+    # zfs snap storage@snap1
+    $ cd /storage/.zfs/snapshot/snap1
+
+Run the index procedure:
+
+    $ glocate -db /tmp/db -index
+
+After that, you can print all filenames:
+
+    $ glocate -db /tmp/db
+
+List them with sizes and mtimes in machine parseable format:
+
+    $ glocate -db /tmp/db -machine
+
+Or in human-friendly tree-like format:
+
+    $ glocate -db /tmp/db -tree
+
+You can limit the hierarchy with the -root:
+
+    $ glocate -db /tmp/db -root music
+    [just a music]
+
+And you can specify glob pattern for case-insensitive match for each
+element path, that is automatically wrapped with "*":
+
+    $ glocate -db /tmp/db -root music blasphemy | grep "/$"
+    music/Blasphemy-2001-Gods_Of_War_+_Blood_Upon_The_Altar/
+    music/Cryptopsy-1994-Blasphemy_Made_Flesh/
+    music/Infernal_Blasphemy-2005-Unleashed/
+    music/Ravenous-Assembled_In_Blasphemy/
+    music/Sect_Of_Execration-2002-Baptized_Through_Blasphemy/
+    music/Spectral_Blasphemy-2012-Blasphmemial_Catastrophic/
+
+If you changed you dataset(s) somehow, then you should create new
+snapshot and feed its diff to the command:
+
+    # zfs snap storage@snap2
+    # zfs diff -FH storage@snap2 |
+      glocate -db /tmp/db -update /storage/
+
+Argument to -update is the prefix stripped from each filename of
+diff's output.