1 |
diff -Nur -x '*.orig' -x '*.rej' smeserver-dar2-0.0.1/root/etc/e-smith/events/actions/dar2-backup mezzanine_patched_smeserver-dar2-0.0.1/root/etc/e-smith/events/actions/dar2-backup |
2 |
--- smeserver-dar2-0.0.1/root/etc/e-smith/events/actions/dar2-backup 2006-10-19 09:23:09.000000000 -0500 |
3 |
+++ mezzanine_patched_smeserver-dar2-0.0.1/root/etc/e-smith/events/actions/dar2-backup 2007-03-22 11:26:12.000000000 -0500 |
4 |
@@ -61,6 +61,10 @@ |
5 |
/bin/mkdir -p $MOUNT/$ID/$DCF || exit 7 |
6 |
fi |
7 |
|
8 |
+# zip and store db's |
9 |
+/bin/echo "Creating $MOUNT/$ID/$DCF/db.zip" |
10 |
+/usr/bin/zip -q -D $MOUNT/$ID/$DCF/db.zip /home/e-smith/db/* |
11 |
+ |
12 |
# expire old backups |
13 |
/bin/echo "Expiring old backups" |
14 |
if [ "$EXPIRY" == "0" ] |
15 |
diff -Nur -x '*.orig' -x '*.rej' smeserver-dar2-0.0.1/root/etc/e-smith/events/actions/dar2-mc mezzanine_patched_smeserver-dar2-0.0.1/root/etc/e-smith/events/actions/dar2-mc |
16 |
--- smeserver-dar2-0.0.1/root/etc/e-smith/events/actions/dar2-mc 2007-01-07 16:53:09.000000000 -0600 |
17 |
+++ mezzanine_patched_smeserver-dar2-0.0.1/root/etc/e-smith/events/actions/dar2-mc 2007-03-22 11:26:12.000000000 -0500 |
18 |
@@ -8,62 +8,51 @@ |
19 |
cp -af /opt/dar2-mc/mc.ext /usr/share/mc |
20 |
fi |
21 |
|
22 |
-# default variables |
23 |
-DAR="/usr/bin/dar" |
24 |
-ID=$(/sbin/e-smith/config get SystemName).$(/sbin/e-smith/config get DomainName) |
25 |
- |
26 |
+# Prompt for job name |
27 |
clear |
28 |
-/bin/echo "Enter where your backup is located: usb | network" |
29 |
-read TYPE |
30 |
- |
31 |
/bin/echo "Enter your job name:" |
32 |
read DCF |
33 |
|
34 |
-if [ "$TYPE" == "usb" ] |
35 |
+# Check job status |
36 |
+STATUS=$(/sbin/e-smith/db /home/e-smith/db/dar2 getprop $DCF status) |
37 |
+if [ "$STATUS" != 'enabled' ] |
38 |
then |
39 |
- # usb variables |
40 |
- /bin/echo "Enter your usb mount point: /media/usbdisk" |
41 |
- read MOUNT |
42 |
- |
43 |
- /bin/echo "Connecting to $MOUNT" |
44 |
- /bin/mount $MOUNT |
45 |
+ exit 0 |
46 |
fi |
47 |
|
48 |
-if [ "$TYPE" == "network" ] |
49 |
- then |
50 |
- # ws variables |
51 |
- MOUNT=/mnt/dar2 |
52 |
- |
53 |
- /bin/echo "Enter your target name: //computername/sharename" |
54 |
- read TARGET |
55 |
- |
56 |
- /bin/echo "Enter your username:" |
57 |
- read USERNAME |
58 |
- |
59 |
- /bin/echo "Enter your password:" |
60 |
- read PASSWORD |
61 |
+# variables |
62 |
+DAR="/usr/bin/dar" |
63 |
+ID=$(/sbin/e-smith/config get SystemName).$(/sbin/e-smith/config get DomainName) |
64 |
+MOUNT=$(/sbin/e-smith/db /home/e-smith/db/dar2 getprop $DCF Mount) |
65 |
+TARGET=$(/sbin/e-smith/db /home/e-smith/db/dar2 getprop $DCF Target) |
66 |
+USERNAME=$(/sbin/e-smith/db /home/e-smith/db/dar2 getprop $DCF Username) |
67 |
+PASSWORD=$(/sbin/e-smith/db /home/e-smith/db/dar2 getprop $DCF Password) |
68 |
+VFSTYPE=$(/sbin/e-smith/db /home/e-smith/db/dar2 getprop $DCF VFSType) |
69 |
|
70 |
- /bin/echo "Enter your filesystem type: smbfs | cifs" |
71 |
- read VFSTYPE |
72 |
+/bin/umount $MOUNT >/dev/null 2>&1 |
73 |
|
74 |
+# mount |
75 |
+if [ "$MOUNT" == "/mnt/dar2" ] |
76 |
+ then |
77 |
MOUNT=$MOUNT/$DCF |
78 |
# create mount dir |
79 |
if [ ! -d $MOUNT ] |
80 |
then |
81 |
/bin/echo "Creating $MOUNT dir" |
82 |
- /bin/mkdir -p $MOUNT |
83 |
+ /bin/mkdir -p $MOUNT || exit 1 |
84 |
fi |
85 |
- /bin/echo "Connecting $MOUNT to $TARGET" |
86 |
- /bin/mount -t $VFSTYPE -o username=$USERNAME,password=$PASSWORD $TARGET $MOUNT |
87 |
+ /bin/echo "Connecting $MOUNT to $TARGET. Please wait..." |
88 |
+ /bin/mount -t $VFSTYPE -o username=$USERNAME,password=$PASSWORD $TARGET $MOUNT || exit 2 |
89 |
+ else |
90 |
+ /bin/echo "Connecting to $MOUNT. Please wait..." |
91 |
+ /bin/mount $MOUNT || exit 3 |
92 |
fi |
93 |
|
94 |
# check backup dir |
95 |
if [ ! -d $MOUNT/$ID/$DCF ] |
96 |
then |
97 |
/bin/echo "Error locating /$ID/$DCF dir" |
98 |
- exit 7 |
99 |
- else |
100 |
- /bin/echo "$MOUNT connected" |
101 |
+ exit 4 |
102 |
fi |
103 |
|
104 |
# run Midnight Commander |
105 |
@@ -73,3 +62,5 @@ |
106 |
# dismount |
107 |
/bin/echo "Dismounting $MOUNT" |
108 |
/bin/umount -l $MOUNT & |
109 |
+ |
110 |
+exit 5 |