]> oss.titaniummirror.com Git - ovzbpc.git/commitdiff
Add makefile to 'build' version into scripts 0.2
authorR. Steve McKown <rsmckown@gmail.com>
Mon, 14 Jan 2013 19:29:00 +0000 (12:29 -0700)
committerR. Steve McKown <rsmckown@gmail.com>
Mon, 14 Jan 2013 20:12:26 +0000 (13:12 -0700)
.gitignore [new file with mode: 0644]
BackupPC_ovz
Makefile [new file with mode: 0644]
bpcbackup
bpcbackup.crontab
bpcdump
esata

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..bbbf928
--- /dev/null
@@ -0,0 +1,2 @@
+build/
+*.swp
index bb4b100dc00322e8bf51b28e616119bcbb65a277..85394502ab86cc36b0dea6040d4ce468f710152d 100755 (executable)
@@ -1,12 +1,11 @@
 #!/usr/bin/perl
 #
 # BackupPC_ovz
+# Version: __appVersion__
 #
 # OpenVZ integration for BackupPC allowing the latter to backup OpenVZ VE's
 # with ovz awareness to improve backup and restore efficiency and features.
 #
-# 20080605     0.1     Initial release
-
 # FIXME: signal handling to clean up mount point and snapshot on termination
 
 use strict;
@@ -329,7 +328,7 @@ sub makeSnapshot($)
     die "Failed to create snapshot device"
   }
   $ve->{'snapdev'} = $snapdev;
-  cmdSystemOrEval("mount -o nouuid $snapdev $snaproot");
+  cmdSystemOrEval("mount -o nouuid,noatime,nodiratime $snapdev $snaproot");
 
   my $snapprivate = $ve->{'private'};
   $snapprivate =~ s|/?$lvmpath/?|/$vzsnap/|;
diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..09b8630
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,38 @@
+INSTALLDIR = build
+
+# version
+VERSION := $(shell git describe --tags --always 2>/dev/null)
+ifneq (,$(VERSION))
+       ifneq (,$(shell git diff-index --name-only HEAD 2>/dev/null))
+       VERSION := $(VERSION)-dirty
+       endif
+else
+       $(error: Run make from a repository checkout)
+endif
+
+SCRIPTS = bpcbackup bpcbackup.crontab bpcdump esata BackupPC_ovz \
+         BackupPC_verifyPool
+SCRIPTFILES = $(SCRIPTS:%=$(INSTALLDIR)/%)
+
+all: install
+
+install: $(INSTALLDIR) $(SCRIPTFILES)
+       @echo "Install dir: $(INSTALLDIR)"
+       @echo "Version: $(VERSION)"
+
+$(INSTALLDIR):
+       @mkdir -p $(INSTALLDIR)
+
+$(SCRIPTFILES):$(INSTALLDIR)/%: % FORCE
+       @sed -e 's|__appVersion__|$(VERSION)|g' < $< > $@-tmp
+       @if diff -q $@-tmp $@ >/dev/null 2>&1; then \
+               rm -f $@-tmp; \
+       else \
+               mv $@-tmp $@; \
+               echo "$@"; \
+       fi
+
+clean:
+       @rm -rf $(INSTALLDIR)
+
+.PHONY: all install $(INSTALLDIR) clean FORCE
index 895ba8f7e93da66aa4f13f90055eeadfe8903301..fcfa138d3db666b0992969a27fdd515348c6350b 100755 (executable)
--- a/bpcbackup
+++ b/bpcbackup
@@ -1,6 +1,8 @@
 #!/bin/bash
 #
 # bpcbackup
+# Version: __appVersion__
+#
 # Copyright (C) 2008 by Titanium Mirror, Inc.
 # Author: R. Steve McKown <smckown@titaniummirror.com>
 #
index cecef035aefc7c78602c97c1ef73e2f4303047fb..d126ec1c8a1f2e4b57b717753697e6452c61a91f 100644 (file)
@@ -1,6 +1,8 @@
 # Crontab file for bpcbackup.
 # Install to /etc/cron.d/bpcbackup
 # File ownership and permissions root:root, 644
+#
+# Version: __appVersion__
 
 # Run the bpcbackup program Tue and Fri mornings at 4am
 #0 4 * * 2,5 root /usr/local/bin/bpcbackup
diff --git a/bpcdump b/bpcdump
index 90ecd0291c7dd2de53f3544e5b37edadae3172da..2978e53430444dfe76d1ce3d466aa557f5580205 100755 (executable)
--- a/bpcdump
+++ b/bpcdump
@@ -1,6 +1,8 @@
 #!/bin/bash
 #
 # bpcdump
+# Version: __appVersion__
+#
 # Copyright (C) 2008-2012 by Titanium Mirror, Inc.
 # Author: R. Steve McKown <smckown@titaniummirror.com>
 #
diff --git a/esata b/esata
index 130eb803a45396e9ddd04cc8cb37e9acc2123ae4..87f08ae643f5831e163267db541b149de4e78c28 100755 (executable)
--- a/esata
+++ b/esata
@@ -1,4 +1,9 @@
 #!/bin/bash
+#
+# esata
+# Version: __appVersion__
+#
+# Add, remove, mount, and unmount external SATA drives
 
 DEV=/dev/sdb2
 MNT=/media/esata