LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Backup (https://www.linuxquestions.org/questions/linux-server-73/backup-611147/)

geek_man 01-04-2008 11:49 AM

Backup
 
Hi!

I need to make incremental backups of the files in a file server. I have read that I can do it with the command tar.

Have you ever used this?
How do you make incremental backups?

Thanks.

Mega Man X 01-04-2008 11:55 AM

Have you tried at all to google for "incremental backups tar". First link has a tutorial about it. It will also give you hints about other backup methods which will be far more detailed than any few lines post somebody can put here.

trickykid 01-04-2008 12:03 PM

I'd suggest using a combination of rsync and tar/gzip. If you know anything about shell scripting, should only take a few minutes to whip up some script to do this for you.

geek_man 01-04-2008 12:48 PM

Backup
 
Hi!

Thanks for the answers.

Mega Man X: I hadn't read that tutorial, now I have. Thanks for the hint. I want to know if someone has used this method (tar), so I can read experiences with this technique and some suggestions.

trickykid: I am going to look for information about this combination(rsync / tar). Do you have experiences using it? Is it the easiest solution for simple backups ( I mean for a file server that hosts some shared files from about 10 computers ) ?

Thanks.

trickykid 01-04-2008 03:46 PM

Quote:

Originally Posted by geek_man (Post 3011326)
Hi!

Thanks for the answers.

Mega Man X: I hadn't read that tutorial, now I have. Thanks for the hint. I want to know if someone has used this method (tar), so I can read experiences with this technique and some suggestions.

trickykid: I am going to look for information about this combination(rsync / tar). Do you have experiences using it? Is it the easiest solution for simple backups ( I mean for a file server that hosts some shared files from about 10 computers ) ?

Thanks.

I use my own rsync scripts to do some backups on my personal servers. If you're dealing with 10 computers you want to backup, you may want to look into something like bacula or amanda. If it's just 10 computers that connect to one file server and you only want to backup that file server, then a simple rsync/tar script would probably be just fine.

Here's a little script I made a long time ago to do a simple daily backup of specified directories to another local location for incremental backups:

Code:

#!/bin/bash

PATH=/bin:/usr/bin
BACKUPDIR=/home/backup/daily

cd $BACKUPDIR
OPTS=" --delete --exclude cache --exclude Cache"

TODAY=`date +%d%b%y`
YESTERDAYDIR=`/bin/ls -lrt | grep ^d | tail -1 | awk '{print $NF}'`

#echo $YESTERDAYDIR

if [ $YESTERDAYDIR != $TODAY ]
then
  cp -al $YESTERDAYDIR $TODAY
else
 echo Retrying Unfinished Backup
fi

rsync $OPTS -a /home/* /$BACKUPDIR/$TODAY

You could easily modify it to tar and gzip the final outcome to compress the data if you need to save space. Then I have another script to clean up after so many days, I keep like a 7 day backup of incrementals, not much changes on this system. Another script I have takes weekly full dumps using rsync to put onto a offsite server I have just in case this server goes bye bye. Maybe this will get you started on some ideas you can do.

choogendyk 01-04-2008 09:58 PM

Of course, if you want to, you can use Amanda to do all that. It has the option of using gnutar and gzip, can go to disk if you choose, and will recycle the backups after whatever interval you choose. It may be overkill for just one system, but after you've written a certain amount of scripting, you reach the point where you might as well have adopted it in the first place. I reached that point some time ago. Anyway, then you will have all the reporting options as well as the ability to easily expand to your other systems or to tape if you choose. And, as a bonus, you've learned another useful program.

trickykid 01-05-2008 09:22 AM

I did actually mention bacula and amanda as a choice. If you know you're only going to have one server, I really don't see the need but if it's the 10 computers or possibly grow those, I would implement a solution instead of home brew scripts.

geek_man 01-07-2008 05:25 PM

Backup
 
Hi!

Thanks for the answers.
I think I was not clear. I just have to backup the information in the file server.
I guess the script will be enough. I will modify it and when it is ready I will post it here.
By the way I will try Amanda, just to check the features and have it as an option in the future.

Thanks.


All times are GMT -5. The time now is 01:27 AM.