Gentoo Archives: gentoo-user

From: Etaoin Shrdlu <shrdlu@×××××××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] File replication
Date: Sun, 27 Aug 2006 12:30:39
Message-Id: 200608271450.00902.shrdlu@unlimitedmail.org
In Reply to: Re: [gentoo-user] File replication by Stephen Liu
1 On Sunday 27 August 2006 13:39, Stephen Liu wrote:
2
3 > The PCs, a workstation only, are not connected to network. Neither
4 > I'll run 2/3 PCs simultaneously.
5
6 Ok, I didn't have this info.
7
8 > Previously I did it in this way making use of an addtional network
9 > card connecting 2 PCs. Later I ceased using this method because
10 > another PC was standing idly.
11
12 If you don't need real-time synchronization, and don't handle gigabyes of
13 data, maybe aliasing umount could be an option (this is kind of hackish,
14 of course):
15
16 -------------------------------------------------------------------
17 #!/bin/bash
18
19 # assuming your removabile device is mounted under /mnt/external
20 # assuming umount is called by mountpoint and not by device name
21
22 MOUNTPOINT="/mnt/external"
23
24 if [ "$1" == "$MOUNTPOINT" ]; then
25
26 echo "Synchronizing..."
27
28 # put here whatever command you want to use for synching, eg rsync
29
30 ....
31
32 fi
33
34 /bin/umount $1
35 exit $?
36 -------------------------------------------------------------------
37
38
39 Save tha above script into a file named "umount", and put it in your path
40 so that it is found before the real /bin/umount. Or you can do the same
41 with a shell alias.
42 Great care must be taken when modifying or aliasing important system
43 commands, since you kind of break the integrity of your system.
44 --
45 gentoo-user@g.o mailing list