summaryrefslogtreecommitdiffstats
path: root/common/update.sh
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2009-12-11 00:18:29 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2009-12-11 00:18:29 +0100
commitcd110f2944e9fb37cd1f21bb869d24949f6941f0 (patch)
tree5642397f290b760373f24fc934b8e2171c431705 /common/update.sh
parent27e0588ee8cb335fe6749f2f076fffbd8c051b84 (diff)
downloadbackup-cd110f2944e9fb37cd1f21bb869d24949f6941f0.tar.gz
backup-cd110f2944e9fb37cd1f21bb869d24949f6941f0.tar.xz
backup-cd110f2944e9fb37cd1f21bb869d24949f6941f0.zip
new version, mysql binlog reset
Diffstat (limited to '')
-rw-r--r--common/update.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/common/update.sh b/common/update.sh
new file mode 100644
index 0000000..c4f0b5f
--- /dev/null
+++ b/common/update.sh
@@ -0,0 +1,18 @@
+# update backup scripts
+
+_self_update() {
+ pushd $(dirname $0) &>/dev/null
+
+ git fetch origin 2>/dev/null
+ if [[ -n "$(git whatchanged HEAD..origin/master)" ]]; then
+ echo "Selfupdating backupscript..." | log
+ git merge origin/master | log
+ echo "Selfupdating done." | log
+ echo | log
+
+ popd &>/dev/null
+ exec $0
+ fi
+
+ popd &>/dev/null
+}