summaryrefslogtreecommitdiffstats
path: root/examples/Cfg
diff options
context:
space:
mode:
authorSol Jerome <solj@ices.utexas.edu>2009-07-31 00:58:06 +0000
committerSol Jerome <solj@ices.utexas.edu>2009-07-31 00:58:06 +0000
commit770daad7cc4db1a2be8de655bd2e4930dbee236d (patch)
treea141a546d66d476267527970acc8d98b29be7592 /examples/Cfg
parent4b26e437feabdc52ea639d017e6083176b281710 (diff)
downloadbcfg2-770daad7cc4db1a2be8de655bd2e4930dbee236d.tar.gz
bcfg2-770daad7cc4db1a2be8de655bd2e4930dbee236d.tar.bz2
bcfg2-770daad7cc4db1a2be8de655bd2e4930dbee236d.zip
example repository: Add Dirvish configuration example
Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5396 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'examples/Cfg')
-rw-r--r--examples/Cfg/etc/cron.d/dirvish/dirvish8
-rw-r--r--examples/Cfg/etc/dirvish/dirvish-cronjob/dirvish-cronjob44
2 files changed, 52 insertions, 0 deletions
diff --git a/examples/Cfg/etc/cron.d/dirvish/dirvish b/examples/Cfg/etc/cron.d/dirvish/dirvish
new file mode 100644
index 000000000..7f7d09117
--- /dev/null
+++ b/examples/Cfg/etc/cron.d/dirvish/dirvish
@@ -0,0 +1,8 @@
+# /etc/cron.d/dirvish: crontab fragment for dirvish
+
+SHELL=/bin/sh
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+MAILTO=root
+
+# run every night
+4 22 * * * root /etc/dirvish/dirvish-cronjob
diff --git a/examples/Cfg/etc/dirvish/dirvish-cronjob/dirvish-cronjob b/examples/Cfg/etc/dirvish/dirvish-cronjob/dirvish-cronjob
new file mode 100644
index 000000000..1dfb1e374
--- /dev/null
+++ b/examples/Cfg/etc/dirvish/dirvish-cronjob/dirvish-cronjob
@@ -0,0 +1,44 @@
+#! /bin/sh
+#
+# daily cron job for the dirvish package
+#
+# NOTE: This is the sample cron job included in Debian. You may need to
+# change the executable paths if running on a different OS.
+if [ ! -x /usr/sbin/dirvish-expire ]; then exit 0; fi
+if [ ! -s /etc/dirvish/master.conf ]; then exit 0; fi
+
+mount_check() {
+ mntout=`tempfile -p mount`
+ mount $1 >$mntout 2>&1
+ if [ ! -d $1/lost+found ]; then # only works for "real" filesystems :-)
+ # (Yes, I know about reiserfs.)
+ echo "'mount $1' failed?! Stopping."
+ echo "mount output:"
+ cat $mntout
+ rm -f $mntout
+ exit 2
+ fi
+
+ if stat $1 | grep 'Inode: 2[^0-9]' >/dev/null; then # ditto
+ rm -f $mntout
+ return 0 # ok
+ fi
+ echo "$1 isn't inode 2 ?! Mount must have failed; stopping."
+ echo ''
+ stat $1
+ echo "mount output:"
+ cat $mntout
+ rm -f $mntout
+ umount $1
+ exit 2
+}
+
+## Example of how to mount and umount a backup partition...
+# mount_check /backup
+
+/usr/sbin/dirvish-expire --quiet && /usr/sbin/dirvish-runall --quiet
+rc=$?
+
+# umount /backup || rc=$?
+
+exit $rc