summaryrefslogtreecommitdiffstats
path: root/examples
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
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')
-rw-r--r--examples/Bundler/sgenshi-dirvish.genshi23
-rw-r--r--examples/Cfg/etc/cron.d/dirvish/dirvish8
-rw-r--r--examples/Cfg/etc/dirvish/dirvish-cronjob/dirvish-cronjob44
-rw-r--r--examples/Properties/dirvish.xml9
-rw-r--r--examples/TGenshi/etc/dirvish/master.conf/template.newtxt25
5 files changed, 109 insertions, 0 deletions
diff --git a/examples/Bundler/sgenshi-dirvish.genshi b/examples/Bundler/sgenshi-dirvish.genshi
new file mode 100644
index 000000000..2eb8acd75
--- /dev/null
+++ b/examples/Bundler/sgenshi-dirvish.genshi
@@ -0,0 +1,23 @@
+<!--
+vim: ft=xml
+-->
+<Bundle name='sgenshi-dirvish' xmlns:py="http://genshi.edgewall.org/">
+<py:for each="user in metadata.Properties['dirvish.xml'].data.find('users')">
+<!-- Generate configs for all users in dirvish.xml -->
+<BoundConfigFile
+ name='/backup/homes/${user.tag}/dirvish/default.conf'
+ owner='root'
+ group='root'
+ perms='0644'>client: nfs-host
+tree: /export/homes/${user.text}
+exclude:
+ *~
+ .nfs*
+</BoundConfigFile>
+</py:for>
+
+<Package name='dirvish'/>
+<ConfigFile name='/etc/cron.d/dirvish'/>
+<ConfigFile name='/etc/dirvish/dirvish-cronjob'/>
+<ConfigFile name='/etc/dirvish/master.conf'/>
+</Bundle>
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
diff --git a/examples/Properties/dirvish.xml b/examples/Properties/dirvish.xml
new file mode 100644
index 000000000..a79733f77
--- /dev/null
+++ b/examples/Properties/dirvish.xml
@@ -0,0 +1,9 @@
+<Properties>
+ <users>
+ <!-- FORMAT: -->
+ <!-- <username>homedir</username> -->
+ <user1>user1homedir</user1>
+ <user2>user2homedir</user2>
+ <user3>user3homedir</user3>
+ </users>
+</Properties>
diff --git a/examples/TGenshi/etc/dirvish/master.conf/template.newtxt b/examples/TGenshi/etc/dirvish/master.conf/template.newtxt
new file mode 100644
index 000000000..6c9750f9d
--- /dev/null
+++ b/examples/TGenshi/etc/dirvish/master.conf/template.newtxt
@@ -0,0 +1,25 @@
+bank:
+ /backup
+
+image-default: %Y-%m-%d
+log: bzip2
+index: bzip2
+xdev: 1
+
+exclude:
+ lost+found/
+ *~
+ .nfs*
+
+Runall:
+{% for user in metadata.Properties['dirvish.xml'].data.find('users') %}\
+ homes/${user.tag}
+{% end %}\
+
+expire-default: +2 weeks
+
+expire-rule:
+# MIN HR DOM MON DOW STRFTIME_FMT
+ * * * * 1 +6 weeks
+ * * 1-7 * 1 +6 months
+ * * 1-7 1,4,7,10 1 never