summaryrefslogtreecommitdiff
path: root/contrib/s3ql.conf
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/s3ql.conf')
-rw-r--r--contrib/s3ql.conf33
1 files changed, 33 insertions, 0 deletions
diff --git a/contrib/s3ql.conf b/contrib/s3ql.conf
new file mode 100644
index 0000000..95e92a7
--- /dev/null
+++ b/contrib/s3ql.conf
@@ -0,0 +1,33 @@
+#
+# This file can be placed in /etc/init. It defines an upstart job that
+# takes care of mounting and unmounting an S3QL file system.
+#
+description "S3QL Backup File System"
+author "Nikolaus Rath <Nikolaus@rath.org>"
+
+# This assumes that eth0 provides your internet connection
+start on (filesystem and net-device-up IFACE=eth0)
+stop on runlevel [016]
+
+env BUCKET="s3://my-backup-bla"
+env MOUNTPOINT="/mnt/backup"
+
+expect stop
+
+script
+ # Redirect stdout and stderr into the system log
+ DIR=$(mktemp -d)
+ mkfifo "$DIR/LOG_FIFO"
+ logger -t s3ql -p local0.info < "$DIR/LOG_FIFO" &
+ exec > "$DIR/LOG_FIFO"
+ exec 2>&1
+ rm -rf "$DIR"
+
+ # Check and mount file system
+ fsck.s3ql --batch "$BUCKET"
+ exec mount.s3ql --upstart "$BUCKET" "$MOUNTPOINT"
+end script
+
+pre-stop script
+ umount.s3ql "$MOUNTPOINT"
+end script