LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 01-09-2006, 09:51 AM   #1
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,689

Rep: Reputation: Disabled
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...
 
Old 01-09-2006, 10:02 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729
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.
 
Old 01-09-2006, 10:08 AM   #3
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,689

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pixellany
If I understand hard links correctly, 2 copies of a file are created.
I thought one copy and the original? Or was that what you meant? And one has to know the file name(s) to create the link(s)...

Quote:
Originally Posted by pixellany
...but this will not help you if you save a file under a new name.
Then I want two new files.

Quote:
Originally Posted by pixellany
I think some applications have options to save a backup when saving files (or maybe that's in Windows... )
True, but they usually write to the same directory.

Quote:
Originally Posted by pixellany
"tee" is not going to work--it is a redirection operator which is used as you are moving data.
Pity...

Quote:
Originally Posted by pixellany
I think the only general solution to this is incremental backup run from a cron file.
Urghs. That's exactly what I did not want .

Last edited by JZL240I-U; 01-10-2006 at 02:58 AM.
 
Old 01-09-2006, 01:04 PM   #4
Lobais
Member
 
Registered: Jan 2004
Location: Denmark
Distribution: Fedora Core 6
Posts: 224

Rep: Reputation: 30
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.
 
Old 01-09-2006, 01:06 PM   #5
alunduil
Member
 
Registered: Feb 2005
Location: San Antonio, TX
Distribution: Gentoo
Posts: 684

Rep: Reputation: 62
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
 
Old 01-11-2006, 06:17 AM   #6
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,689

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by JZL240I-U
...I don't want a cron-job or raid but something like a link with two targets. ...
Was what I wrote initially . Thanks for your suggestions anyhow -- if I find a solution later, I'll come back and let you know...
 
Old 05-08-2006, 04:13 AM   #7
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,689

Original Poster
Rep: Reputation: Disabled
Okay, I caved in . I use now rsnapshot and cron, see also http://www.rsnapshot.org/howto/1.2/r...-HOWTO.en.html
 
Old 05-08-2006, 05:51 AM   #8
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 46
Wouldn't RAID1 be what you want?
 
Old 05-08-2006, 06:06 AM   #9
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,689

Original Poster
Rep: Reputation: Disabled
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.

Last edited by JZL240I-U; 05-08-2006 at 06:07 AM.
 
Old 07-19-2006, 09:44 AM   #10
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian 4.0 Etch
Posts: 1,349

Rep: Reputation: 49
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.
 
Old 07-19-2006, 09:49 AM   #11
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,689

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by IsaacKuo
Since you said you were still open to suggestions (in another thread)...
So I am, as always .

Quote:
Originally Posted by IsaacKuo
...Obviously, you want the two+ mirrored partitions to be on different physical drives--preferably on different physical channels.
Yes I do. Is that what RAID-1 does? Then I remembered the RAID scheme the wrong way. I'll have to read up on that. Is it possible to run RAID-1 on disks of differing sizes (e.g. on a 250 GB and a 10GB, with partition-sizes like 2,5 GB)?

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...

Last edited by JZL240I-U; 07-19-2006 at 10:39 AM.
 
Old 07-19-2006, 09:55 AM   #12
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 46
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.
 
Old 07-19-2006, 10:15 AM   #13
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,689

Original Poster
Rep: Reputation: Disabled
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?
 
Old 07-19-2006, 11:25 AM   #14
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian 4.0 Etch
Posts: 1,349

Rep: Reputation: 49
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".
 
Old 07-19-2006, 11:31 AM   #15
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,689

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by IsaacKuo
... 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".
Hm, yeah. An old vice of mine which I might abandon anyhow. I saved some software packets there for easier installation. I do that now at /NotSuSE, but that is no partition ... yet .
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mandrake's backup won't save my settings! jamespetts Linux - Software 2 08-19-2004 03:26 PM
Backup system - which directories to save? geodo Linux - Newbie 2 05-28-2004 12:15 AM
How to keep restorable monitor and 3D settings tar backup simple save configurat zaphod111 Linux - Newbie 2 11-08-2003 08:39 PM
Selective backup to CDRW, or other backup methods. trekk Linux - Software 1 11-03-2003 03:46 PM
backup and update the backup file doris Linux - General 4 08-24-2002 08:26 PM


All times are GMT -5. The time now is 04:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration