Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Howto Do a Backup.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
zecora
l33t
l33t


Joined: 17 Aug 2004
Posts: 627
Location: Minneapolis, MN

PostPosted: Tue Apr 05, 2005 4:12 pm    Post subject: Howto Do a Backup. Reply with quote

I am wondering how i should go about doing this. I have a fileserver, and other gentoo boxes in my house. How can i run a script or have my computers backup the information i want? What i want is a dedicated backup server, that houses all my docs or files i want to back up. how do i have my boxes backup what i want, what do i need to do?


Does this make sense?
Back to top
View user's profile Send private message
BlackEdder
Advocate
Advocate


Joined: 26 Apr 2004
Posts: 2588
Location: Dutch enclave in Egham, UK

PostPosted: Tue Apr 05, 2005 4:31 pm    Post subject: Reply with quote

I'd setup the clients to use rsnapshot to backup over ssh to the server.
http://www.rsnapshot.org/rsnapshot.html
Back to top
View user's profile Send private message
zecora
l33t
l33t


Joined: 17 Aug 2004
Posts: 627
Location: Minneapolis, MN

PostPosted: Tue Apr 05, 2005 4:48 pm    Post subject: Reply with quote

how does it work for you?


Is it hard to set up for a beginner?
Back to top
View user's profile Send private message
BlackEdder
Advocate
Advocate


Joined: 26 Apr 2004
Posts: 2588
Location: Dutch enclave in Egham, UK

PostPosted: Tue Apr 05, 2005 4:57 pm    Post subject: Reply with quote

I found rsnapshot fairly easy to setup. Never tried it over a network though, but it should be easy enough. BTW I'm assuming all your clients are linux machines.

One the server make sure ssh is working, then setup an account backups (or something similar). On every client install rsnapshot (emerge rsnapshot) and configure /etc/rsnapshot.conf. You can use rsnapshot.conf.default as an example and the site has more information how to configure it.

This thread: https://forums.gentoo.org/viewtopic-t-299869-highlight-rsnapshot.html also has some info.
Back to top
View user's profile Send private message
zecora
l33t
l33t


Joined: 17 Aug 2004
Posts: 627
Location: Minneapolis, MN

PostPosted: Tue Apr 05, 2005 5:29 pm    Post subject: Reply with quote

It makes sense what i want to do right?

What i want is my fileserver to get backed up of all the files or dirs i have selected. I want them to be transfered over to a
backup server. This process i at least want to happen once a week. What else i want is for my other gentoo boxes to get a backup once a week of selected config files. So i do not erase them or i reinstall the box.
Back to top
View user's profile Send private message
Naan Yaar
Bodhisattva
Bodhisattva


Joined: 27 Jun 2002
Posts: 1549

PostPosted: Wed Apr 06, 2005 1:59 am    Post subject: rdiff-backup Reply with quote

I use rdiff-backup to back up my machine to a USB drive. However, it can backup to a remote machine too. One big advantage using rdiff-backup is that it stores the current state as is and also lets you keep older versions as diffs. This makes it very efficient and allows you to go back to older versions of files. This feature has saved my butt a couple of times when a misbehaving ebuild blew away a config file and the latest version on the backup was itself a bad version; I was able to get to an older version that worked.
Back to top
View user's profile Send private message
zecora
l33t
l33t


Joined: 17 Aug 2004
Posts: 627
Location: Minneapolis, MN

PostPosted: Wed Apr 06, 2005 3:38 pm    Post subject: Reply with quote

is it in portage? can i get a howto?
Back to top
View user's profile Send private message
racoontje
Veteran
Veteran


Joined: 19 Jul 2004
Posts: 1290

PostPosted: Wed Apr 06, 2005 9:15 pm    Post subject: Reply with quote

rsync for files, I guess.


dd if=/dev/partition and pipe it to tar?
Back to top
View user's profile Send private message
jdgill0
Veteran
Veteran


Joined: 25 Mar 2003
Posts: 1366
Location: Lexington, Ky -- USA

PostPosted: Wed Apr 06, 2005 10:06 pm    Post subject: Reply with quote

BlackEdder wrote:
I'd setup the clients to use rsnapshot to backup over ssh to the server.
http://www.rsnapshot.org/rsnapshot.html


This does look interesting for backups. Some time ago I was looking for a means to do rotating backups, for local backups as well as across the network. I had looked at rdiff-backup back then as well, but with Gentoo you really don't want/need backup information too far in the past given Gentoo is ever-evolving at a rapid pace.
Back to top
View user's profile Send private message
asiobob
Veteran
Veteran


Joined: 29 Oct 2003
Posts: 1375
Location: Bamboo Creek

PostPosted: Thu Apr 07, 2005 12:47 am    Post subject: Reply with quote

I use Sarab (http://sarab.sf.net) which is a script that controls DAR. SaraB does rotations and full, differential, and incremental backups. DAR is the actual back up program. There are some nice GUI front ends as well but I've never used em
Back to top
View user's profile Send private message
jdgill0
Veteran
Veteran


Joined: 25 Mar 2003
Posts: 1366
Location: Lexington, Ky -- USA

PostPosted: Thu Apr 07, 2005 1:12 am    Post subject: Reply with quote

ASIO_BOB wrote:
I use Sarab (http://sarab.sf.net) which is a script that controls DAR. SaraB does rotations and full, differential, and incremental backups. DAR is the actual back up program. There are some nice GUI front ends as well but I've never used em


Sounds like it could be a bit complicated to setup and use. Furthermore, it's not only a matter of making backups, but also the ease of restoration from your backups. How complicated is it to restore from Sarab backups?
Back to top
View user's profile Send private message
asiobob
Veteran
Veteran


Joined: 29 Oct 2003
Posts: 1375
Location: Bamboo Creek

PostPosted: Thu Apr 07, 2005 1:27 am    Post subject: Reply with quote

trivial.
With the front ends its easy.

DAR = Disk Archive. It aims to back up to Disks like CDs, DVD, FLASH, hard drives. Anything really thats not tape.
Running dar by itself is possible, but the comand becomes really long. It can do stuff like main backup and differentials againts that main one (for smaller size). You can even extract the catelog out of the main backup so you odn't have to have the main one to create the next one. You can basically recover files easily by reading the man page or using the GUI tools which makes life 10x easier.

SaraB is a rotation script. Using this as your back up wrapper you don't have to know lines of DAR command line options. Just set your rotation policy in a file like

week1
monday
tuesday
wednesday
thursday
friday
saturday
Week2
..
...


(I have up to week 4). So weekX is a main back up, the days mon-sat backup against that week. It's now also trival to set up exclusions, for a system back up I exclude /dev for an example and /proc. Sarab makes all this easy because it then runs dar for you.

I've recovered a file before and it was very easy.
Back to top
View user's profile Send private message
jdgill0
Veteran
Veteran


Joined: 25 Mar 2003
Posts: 1366
Location: Lexington, Ky -- USA

PostPosted: Thu Apr 07, 2005 1:42 am    Post subject: Reply with quote

Thanks ASIO_BOB for the description/info. I will check it out. There seem to be several good backup options available in portage now adays.
Back to top
View user's profile Send private message
asiobob
Veteran
Veteran


Joined: 29 Oct 2003
Posts: 1375
Location: Bamboo Creek

PostPosted: Thu Apr 07, 2005 2:24 am    Post subject: Reply with quote

dar is on portage, sarab from sourceforge is a tiny script.
Also in the example I provided it is assumed you actually run sarab, it won't run it self.
So in my example you want a cronjob to run it daily. if you run it more than once a day sarab will rotate the days and weeks as it thinks you are doing it once a day.

The content of hte rotation file can be anything , I like Week1 etc.. but you can do it

"dsfdsf"
"blah dsfdsf"

in which case the first back up is a full one, the next backup "blah" is based of "dsfdsf" :D
Back to top
View user's profile Send private message
Naan Yaar
Bodhisattva
Bodhisattva


Joined: 27 Jun 2002
Posts: 1549

PostPosted: Thu Apr 07, 2005 4:09 am    Post subject: rdiff-backup Reply with quote

It is in portage:
Code:

dual src # emerge -s rdiff-backup
Searching...
[ Results for search key : rdiff-backup ]
[ Applications found : 1 ]

*  net-misc/rdiff-backup
      Latest version available: 0.13.4
      Latest version installed: 0.13.4
      Size of downloaded files: 140 kB
      Homepage:    http://rdiff-backup.stanford.edu/
      Description: Remote incremental file backup utility, similar to rsync butmore reliable
      License:     GPL-2


I use a simple script that looks like as follows:
Code:

#
#!/bin/sh
#
echo "Backup script started at: $(date)"

if [[ "$(df | grep /backup)" = "" ]]; then
  mount /backup
  backup_mounted="y"
  echo "Mounted backup directory"
  df | grep /backup
else
  echo "Backup directory already mounted"
fi

# do the backups
/usr/bin/rdiff-backup --exclude-other-filesystems / /backup/root
/usr/bin/rdiff-backup --exclude-other-filesystems /home /backup/home
echo "Backup done"

# sync the disks for safety sake
sync
echo "Synced disks"

# unmount /backup if we mounted it
if [[ "$backup_mounted" = "y" ]]; then
  umount /backup
  echo "Unmounted backup directory"
fi

# status
echo "Backup script finished successfully at: $(date)"

In the above script, /backup is the mountpoint for the backup partition which, in my case, is a usb hard drive (external). This script is called from a cron entry like this:
Code:

12 12 * * mon,wed,fri /usr/local/sbin/rdiff-backup.sh

Since rdiff-backup stores the older versions of the backup as diffs, it is efficient. For example, on my machine, the /home backup looks like this:
Code:

dual src # rdiff-backup --list-increment-sizes /backup/home
-----------------------------------------------------------------
Detected abilities for archive (read/write) file system:
  Characters needing quoting                   ''
  Ownership changing                           On
  Hard linking                                 On
  fsync() directories                          On
  Directory inc permissions                    On
  Access control lists                         Off
  Extended attributes                          Off
  Mac OS X style resource forks                Off
  Mac OS X Finder information                  Off
-----------------------------------------------------------------
        Time                       Size        Cumulative size
-----------------------------------------------------------------------------
Wed Apr  6 12:33:33 2005         2.70 GB           2.70 GB   (current mirror)
Mon Apr  4 12:43:01 2005         35.7 MB           2.73 GB
Fri Apr  1 13:58:55 2005          130 MB           2.86 GB
Wed Mar 30 13:57:59 2005         2.93 MB           2.86 GB
Mon Mar 28 13:38:10 2005         2.68 MB           2.87 GB
Fri Mar 25 13:57:28 2005         3.45 MB           2.87 GB
Wed Mar 23 14:28:55 2005         2.71 MB           2.87 GB
Mon Mar 21 14:13:26 2005         5.29 MB           2.88 GB
Fri Mar 18 13:30:51 2005         4.64 MB           2.88 GB
Wed Mar 16 13:31:34 2005         2.91 MB           2.89 GB
Mon Mar 14 13:35:00 2005         2.63 MB           2.89 GB
Fri Mar 11 13:41:00 2005         2.72 MB           2.89 GB
Mon Mar  7 13:57:20 2005         4.58 MB           2.89 GB
Fri Mar  4 13:38:08 2005         3.72 MB           2.90 GB

As you can see from the above, there are 14 backups with the current one being 2.7GB and the older ones (stored in differential format) are 0.2GB in all. I periodically clean up older backups by doing:
Code:

rdiff-backup --remove-older-than 30D --force /backup/root

to remove backups older than 30 days. You can use the "-r" option to restore older versions. More examples here: http://www.nongnu.org/rdiff-backup/examples.html
zecora wrote:
is it in portage? can i get a howto?
Back to top
View user's profile Send private message
zecora
l33t
l33t


Joined: 17 Aug 2004
Posts: 627
Location: Minneapolis, MN

PostPosted: Fri Apr 08, 2005 7:16 pm    Post subject: Reply with quote

thx for all the good programs i can try. I will give it a shot and keep ya updated.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum