LinuxQuestions.org
Review your favorite Linux distribution.
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 11-08-2003, 09:55 PM   #1
usb1
LQ Newbie
 
Registered: Nov 2003
Posts: 17

Rep: Reputation: 0
Question Linux backup


Hello . Can someone show me a linux software to do an automatic backup to a partition or ftp.? What I want to do is backup some important files of my linux box. It would be good if I can access the software using the browser.
 
Old 11-08-2003, 11:28 PM   #2
saint
Member
 
Registered: Sep 2001
Location: India
Distribution: Red Hat 9
Posts: 55

Rep: Reputation: 15
I have not heard of any backup softwares which can be used via a browser. If you want to go in for a commercial product, Bru is considered to a good option. (Disclaimer: I have not used it). A good article on backing up and a script to do it can be found at http://www.linuxgazette.com/issue47/pollman.html Another good one is http://www.linuxgazette.com/issue91/keates.html . Both are quite well written. Check them out
 
Old 11-09-2003, 01:49 AM   #3
bobthebaritone
Member
 
Registered: Aug 2003
Location: Newington, Sydney, Australia
Distribution: Fedora Whitebox 4 Ubuntu
Posts: 40

Rep: Reputation: 15
There i a very important procedure at stake here. If you need to backup consder the achievment of just securing your data. SSH can provide some invaluable features here!


Don't forget that backups don't have to frilly - just get the job done!


SSH has some web based friends....

Check it out from google....

Regards
 
Old 11-09-2003, 06:32 AM   #4
linuxfond
Member
 
Registered: Jan 2003
Location: Belgium
Distribution: Mandrake 9.2
Posts: 475

Rep: Reputation: 30
Write a simple batch script which will regularly backup the files and folders of your choice, and compress them really well (tar.gz for example).
I do automatic daily backup of my office work, and monthly backups of the entire system to the second HD.
 
Old 11-09-2003, 07:27 AM   #5
DirtDart
Member
 
Registered: Nov 2003
Distribution: Mandrake 10.1/Solaris 10 (sparc)
Posts: 96

Rep: Reputation: 16
Not sure what distro you're using, but here's a good link with some good info:

http://www.desktop-linux.net/backups.htm
 
Old 11-09-2003, 08:20 AM   #6
usb1
LQ Newbie
 
Registered: Nov 2003
Posts: 17

Original Poster
Rep: Reputation: 0
Thank you all for the reply. One more last question for linuxfond. something like what you wrote I want to make. How can I make that script? do you have a copy or a place where I can get that script? I am using Netmax 4.5 .I dont know if you guys heard about that. netmax.com. Thank you..
 
Old 11-09-2003, 10:17 AM   #7
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
Well the script depends on what you are backing up and where you are backing it up to. Something like:

#!/bin/sh
tar cpvf backup.tar /directory/you/want/to/backup
gzip backup.tar
cp backup.tar.gz /directory/you/want/to/backup/to
 
Old 11-09-2003, 11:37 AM   #8
linuxfond
Member
 
Registered: Jan 2003
Location: Belgium
Distribution: Mandrake 9.2
Posts: 475

Rep: Reputation: 30
That's right.

Now I'd sugget to make a folder "scripts" or something like that, and save your new batch file, say, "office_daily" or "system_monthly" in that folder. Don't forget to make your batch executable.

Test if it works the way you want. Go to shell and issue ./office_daily and see if it doesn't abort (It will abort if you did not chmod your folders 755 and did not make your files readable).

If it runs ok, check the created archive. If it opens and everything is fine - great. If not, check if you did not leave an empty line at the top of your batch script. Check also that your archive is readable in all PCs at hand.

What's left to do is to schedule this script to run daily or monthly at certain time. See what you have in your distro available for schedulling.

Here is the script:

#!/bin/bash

#Create a compressed backup of all the directories specified and put the resulting file in a directory of your choice. This will backup everything in your /home.

BACKUP_DIRS="$HOME"

# This backup adds date to the file name, therefore your backups are not overwritten. Modify it if you like your backup to be overwritten every time.

DATESTR=`date "+%Y-%m-%d"`
BACKUP_DEST_DIR="/mnt/win_c/linux_backup"
BACKUP_FILENAME="office-daily-backup-$DATESTR"

#We do a BZipped backup here...

tar cvjf $BACKUP_DEST_DIR/$BACKUP_FILENAME.tar.bz2 $BACKUP_DIRS

# Send an email on that occasion:
echo Hi there your office work was saved | mail your@email.he

********************

N.B. In windoz you will need bzip2.exe to unbzip your archives. Download it from the net if you don't have it yet.
 
Old 11-09-2003, 11:40 AM   #9
linuxfond
Member
 
Registered: Jan 2003
Location: Belgium
Distribution: Mandrake 9.2
Posts: 475

Rep: Reputation: 30
Just a little addition to my post above:

My /home/ dir in tar.bz2 form is over a gig. That mean I can not write it to a CD-Rom. How do I hell enable multivolume -M support in that batch above and how to tell it to backup only modified and new files?
Thanks

Last edited by linuxfond; 11-09-2003 at 11:46 AM.
 
Old 11-09-2003, 11:40 AM   #10
mlp68
Member
 
Registered: Jun 2002
Location: NY
Distribution: Gentoo,RH
Posts: 333

Rep: Reputation: 40
I couldn't follow the other links given, so maybe it's mentioned there, but of late the so-called "hard-link" solution has seen very good reviews, and I have been using it for about a year with good results. It's just a few lines of script.

The trick is to rsync the directory tree to be backed up file to another disk. When done, make hard links to each and every file to another directory tree, e.g.

cp -al . <some name with the date in it>

Next day, rsync to the same place again. When rsync recognizes a modified file, it "removes" (more specifically, unlinks) the file on the backup area. So a new file is generated. Yesterday's file still has the hard link in the other area, and is still around, and you can get it from yesetrday's directory. Today's hard-link operation (the cp -al ) will hard-link the new file.

If no files ever get modified, you just keep adding hardlinks to already existing files, using up very little space. Each time a file does get modified or a new one gets created, it gets on the backup disk and will then get more hardlinks until modified again.

So each day, you have the true snapshot of the file system. But each day, only actually modified or new files get on the backup. In a system where files are modified sporadically, this is a very elegant solution.

It does not work so well where large files are modified each day, e.g. mail files. It still works, but you keep copying new versions to your backup.

But the real advantage is if you mount the backup file system back for user access read-only, each user can retrieve a given file on his or her own, and you don't have to deal with rolling back incremental tar files if a user inadvertantly deletes an important file.

I can share the script if there is interest.

mlp
 
Old 11-09-2003, 01:38 PM   #11
zaphod111
Member
 
Registered: Nov 2003
Posts: 40

Rep: Reputation: 15
one time back up to save system settings?

Sorry to hijack your thread but it seems the right place to ask...

Is it right that making a tarball of /boot and /etc/x11 should enable settings for 3D graphics, monitor and other peripherals to be reinstated if required?

To reinstate these settings is a tarball of /usr/src/linux also required?

Do any other directories need to be saved?

Thanks in advance.
 
Old 11-09-2003, 01:49 PM   #12
linuxfond
Member
 
Registered: Jan 2003
Location: Belgium
Distribution: Mandrake 9.2
Posts: 475

Rep: Reputation: 30
I don't know, but one thing sure - backup doesn't hurt.
 
Old 11-09-2003, 07:37 PM   #13
usb1
LQ Newbie
 
Registered: Nov 2003
Posts: 17

Original Poster
Rep: Reputation: 0
Thank you all for your help. One more question. If i dont want to compress the files I just want to move the files exacly the way they are. What do i need to do on the script that linuxfond made?>
Thanks again
 
Old 11-09-2003, 08:48 PM   #14
mlp68
Member
 
Registered: Jun 2002
Location: NY
Distribution: Gentoo,RH
Posts: 333

Rep: Reputation: 40
If you don't want compression, you should try the rsync script. Here's mine. It assumes that it backs up from a place called "FROM" - set the value accordingly.

/backup is my backup file system. Each night, we rsync to /backup/current, then do the hard-linking to a directory 2003-11-09 for tonight.

Code:
#! /bin/sh

DATE=`date "+%Y-%m-%d"`

FROM=<set this to your file system you want to back up>

TO=/backup/current
TOPDIR=/backup
LOG=/root

# rsync the file system to the "current" directory
/usr/bin/rsync -a $FROM $TO > $LOG/$DATE.log 2>&1

# now cd there - we need a relative path
cd $TO

# now construct a "daily" directory name
DAILY_DIR=$TOPDIR/$DATE

# make this directory if it doesn't exist
[ -d $DAILY_DIR ] || mkdir $DAILY_DIR

# now make mirror of hardlinks in the "daily" directory
/bin/cp -al .  $DAILY_DIR/ >>  $LOG/$DATE.log 2>&1

# that's it. Run this from cron once a night or so.
Here is an example of a file that hasn't changed in a while, named monitoring/c2.ps.

Code:
# ls -i1 /backup/2003-10-*/monitoring/c2.ps
6701091 /backup/2003-10-01/monitoring/c2.ps
6701091 /backup/2003-10-02/monitoring/c2.ps
6701091 /backup/2003-10-03/monitoring/c2.ps
6701091 /backup/2003-10-04/monitoring/c2.ps
6701091 /backup/2003-10-05/monitoring/c2.ps
6701091 /backup/2003-10-06/monitoring/c2.ps
6701091 /backup/2003-10-07/monitoring/c2.ps
6701091 /backup/2003-10-08/monitoring/c2.ps
6701091 /backup/2003-10-09/monitoring/c2.ps
6701091 /backup/2003-10-10/monitoring/c2.ps
6701091 /backup/2003-10-11/monitoring/c2.ps
6701091 /backup/2003-10-12/monitoring/c2.ps
6701091 /backup/2003-10-13/monitoring/c2.ps
6701091 /backup/2003-10-14/monitoring/c2.ps
6701091 /backup/2003-10-15/monitoring/c2.ps
6701091 /backup/2003-10-16/monitoring/c2.ps
6701091 /backup/2003-10-17/monitoring/c2.ps
6701091 /backup/2003-10-18/monitoring/c2.ps
6701091 /backup/2003-10-19/monitoring/c2.ps
6701091 /backup/2003-10-20/monitoring/c2.ps
6701091 /backup/2003-10-21/monitoring/c2.ps
6701091 /backup/2003-10-22/monitoring/c2.ps
6701091 /backup/2003-10-23/monitoring/c2.ps
6701091 /backup/2003-10-24/monitoring/c2.ps
6701091 /backup/2003-10-25/monitoring/c2.ps
6701091 /backup/2003-10-26/monitoring/c2.ps
You can see that this file exists only once, and that all entries in the directories are a link to the same inode 6701091.

Here's the .login file of that account, which was changed on 9/17, then again on 9/21, and has been stable since. We see the inodes, and with it the actual file, change on those dates, and continue to be links to the same files on other days.


Code:
4758100 /backup/2003-05-15/monitoring/.login
4758100 /backup/2003-09-11/monitoring/.login
4758100 /backup/2003-09-12/monitoring/.login
4758100 /backup/2003-09-13/monitoring/.login
4758100 /backup/2003-09-14/monitoring/.login
4758100 /backup/2003-09-15/monitoring/.login
4758100 /backup/2003-09-16/monitoring/.login
4756707 /backup/2003-09-17/monitoring/.login
4756707 /backup/2003-09-18/monitoring/.login
4756707 /backup/2003-09-19/monitoring/.login
4756707 /backup/2003-09-20/monitoring/.login
4756707 /backup/2003-09-21/monitoring/.login
4756717 /backup/2003-09-22/monitoring/.login
4756717 /backup/2003-09-23/monitoring/.login
4756717 /backup/2003-09-24/monitoring/.login
4756717 /backup/2003-09-25/monitoring/.login
4756717 /backup/2003-09-26/monitoring/.login
4756717 /backup/2003-09-27/monitoring/.login
In this way, we use space only for the 3 versions of that file, no more (ok, a little bit for the hard link).

Hope it's useful,

mlp
 
  


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
DISCUSSION: Using Linux to backup and recover Windows and Linux systems shshjun LinuxAnswers Discussion 3 12-05-2009 10:42 PM
Linux backup rockwell_001 Linux - General 7 04-29-2005 07:08 PM
How do YOU backup Linux? paulinimus Linux - Software 11 08-26-2004 06:34 AM
Linux Backup mallikar Linux - Newbie 1 06-07-2003 09:55 AM
How to backup my linux CobraMagic Linux - General 4 09-13-2002 12:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:53 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration