Add local and chroot backends.
[matthijs/upstream/backupninja.git] / lib / backends / local.in
diff --git a/lib/backends/local.in b/lib/backends/local.in
new file mode 100644 (file)
index 0000000..069e201
--- /dev/null
@@ -0,0 +1,33 @@
+# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*-
+# vim: set filetype=sh sw=3 sts=3 expandtab autoindent:
+
+function backend_local_init () {
+       # We're always available
+       return 0
+}
+
+function backend_local_host_available () {
+   if [ -n "$1" ]; then
+      eval "$2=The local backend does not support named hosts: '\$1'"
+      return 1
+   fi
+   # The empty host (i.e., "local:") is always available
+   return 0
+}
+
+function backend_local_host_root () {
+   # We just use the entire filesystem
+   echo ""
+}
+
+function backend_local_run () {
+   # Running locally is simple, just run the command
+   "$@"
+}
+
+function backend_local_interpolate_vars () {
+   echo ""
+}
+
+function backend_local_interpolate_value () {
+}