How to save twice (backup)?
Is there a possibility to save files automatically in two places (e.g. in /home/user/documents on /dev/hda2 and simultaneously in /backup/user/documents on /dev/hdc5)? This should be something like a rule for a directory, like "if you get a new or altered file, copy it to that other location but pronto and no discussion" ;)
I don't want a cron-job or raid but something like a link with two targets. Could one use "tee" with links? But I can't see how that should be set up... |
If I understand hard links correctly, 2 copies of a file are created. but this will not help you if you save a file under a new name.
I think some applications have options to save a backup when saving files (or maybe that's in Windows...;) ) "tee" is not going to work--it is a redirection operator which is used as you are moving data. I think the only general solution to this is incremental backup run from a cron file. |
Quote:
Quote:
Quote:
Quote:
Quote:
|
There is some tools, that can make two hard disk twins, or what it is called. Anything one filesystem writes, the other disk til write too.
Sadly I can't remember what it is called, but RAID and LVM are different ways of handling the disks. Maybe one of them has the solution. |
If you look around for I believe in google howto raid0 you should come up with something similar to what you are looking for.
Regards, Alunduil |
Quote:
|
Okay, I caved in ;). I use now rsnapshot and cron, see also http://www.rsnapshot.org/howto/1.2/r...-HOWTO.en.html
|
Wouldn't RAID1 be what you want?
|
Not really. What I originally wanted, was the immediate backup / duplication of any document edited on the machine (my wife's OpenOffice documents, to be precise), so that in any instant a recovery of the latest version would be possible. It is the same machine I perform my linux experiments on ;) so...
Now I just have to remember to type in "rsnapshot" before I start with something. |
Since you said you were still open to suggestions (in another thread)...
In what way is software RAID-1 not acceptable? It keeps all copies of the partition in sync at all times. Obviously, you want the two+ mirrored partitions to be on different physical drives--preferably on different physical channels. |
Quote:
Quote:
Explanation of my erstwhile question: RAID works on whole partitions. I just wanted duplicates of files in /home/<user1> and /home/<user2> plus /root and /NotSuSE/Software and saving of changes in both locations at once. Maybe I just aspired for too small a solution... |
RAID-1 is done on 2 partitions, but they should be the same size, otherwise you'll lose some storage. So if you create two 2,5GB partitions, that'll work fine, regardless of the physical disk size.
|
Thanks, uselpa. Just for the "quick and dirty" understanding: If, for example, hda crashes, how can one get access to /hdb4 where the mirrored raid 1 resides? Could I just normally open e.g. /home/user/my/document after seeing an error during boot for hda and handle the problem later?
|
Yes, either of the mirrored partitions can be accessed after a crash.
There's no way to specify only mirroring a particular directory, so what you'd want to do instead is: 1. Create a small RAID-1 set of partitions for the desired mirrored data. 2. Mount that RAID-1 set (e.g. /dev/md0) somewhere like /mnt/md0 3. Create one or more subdirectories in /mnt/md0 for the desired backed up directories. 4. Create symbolic links in the "virtual" locations for these directories pointing at the subdirectories within /mnt/md0. That said, I have had spotty luck with using a symbolic link for a user's home directory. In your case, I'd probably simply mount a RAID-1 partition directly to /home (thus encompasing all users's home directories, other than root). I can't think of any reason why instant mirroring of root's home directory would be desirable. Theoretically, you shouldn't be doing stuff which affects root's home directory very often, and when you do you more likely want to restore to an older manual backup rather than some semi-corrupted "latest and greatest". |
Quote:
|
All times are GMT -5. The time now is 12:01 AM. |