This site is now 100% read-only, and retired.

Backing up files

Posted by Steve on Tue 28 Sep 2004 at 13:26

When you're working against a deadline chances are this is the time diasaster will strike.

Either hardware error, or user error, will cause you to delete the files you're working on. Just when you can cope with this less.

It's at times like this you'll wish you had backup.

There are several types of backups:

  • Local backups
  • remote Backups

Local backups are usually on the same machine as your primary files. These will be useful if you accidently delete files you need, but if your house explodes they'll be useless.

Remote backups are copies of your files stored on a different system, ideally one at a different physical location.

 

 


Re: Backing up files
Posted by Anonymous (128.187.xx.xx) on Fri 6 May 2005 at 05:15
I'm confused.... I came to this article expecting to find information on how to _administer_ my system... did I just miss it??

[ Parent ]

Re: Backing up files
Posted by Steve (82.41.xx.xx) on Fri 6 May 2005 at 05:27
[ View Weblogs ]

Articles numbered lower than around 10-15 were just test ones so that I could make sure the software was working.

Steve
-- Steve.org.uk

[ Parent ]

Re: Backing up files
Posted by thomasking (68.92.xx.xx) on Wed 7 Sep 2005 at 19:15
hmmn... well how about some help on making a simple backup script as a chronjob that backs up... say all the home directories... one that would run once a week and tar the whole /home recursively and then gzip the tar and store it in say /backups?

this would be a simple thing to do and this is supposed to be a forum for newbies, eh?

[ Parent ]

Re: Backing up files
Posted by Steve (82.41.xx.xx) on Wed 7 Sep 2005 at 19:20
[ View Weblogs ]

There have been several pieces on backups, including:

I think the piece on rsnapshot would probably be suitable, it's very simple to setup and use.

Whilst I'd like to go back and remove/edit/fleshout the initial "test" articles I've not really got the time to do so.

Just ignore articles <20 and you'll be fine.

Steve
--

[ Parent ]

Re: Backing up files
Posted by thomasking (68.92.xx.xx) on Thu 8 Sep 2005 at 07:46
hmmn.. well rsnapshot didnt make tar gz out of things... it made directories.... did I do something wrong? all of my attempts of creating a script to tar directories and compress have failed...

[ Parent ]

Re: Backing up files
Posted by Steve (82.41.xx.xx) on Thu 8 Sep 2005 at 07:51
[ View Weblogs ]

Creating a gzip'd tar file of a couple of directories and rotating them should be simple enough:

#!/bin/sh

# Create temporary tar file of /etc, /home, etc.
tar -czvf tmp.tar.gz /etc /home  /var/lib/dpkg

# Recycle older ones
mv 4.tar.gz 5.tar.gz
mv 3.tar.gz 4.tar.gz
mv 2.tar.gz 3.tar.gz
mv 1.tar.gz 2.tar.gz

# move temporary one into placwe
mv tmp.tar.gz 1.tar.gz

Still rsnapshot doesn't create compressed archives, because it is more space efficient. Despite containing a weeks worth of backups only changed files are stored after the initial literal copy.

So in practise storing things uncompressed saves you space.

Steve
--

[ Parent ]

Re: Backing up files
Posted by thomasking (68.92.xx.xx) on Thu 8 Sep 2005 at 15:00
thanks Steve!

the goal here is to drop one file onto a windoze machine and that person will be responsible for burning it to cd. thats why I wanted to gzip it.

anyways, thanks a lot... I have been struggling with the tar syntax. always getting errors.

[ Parent ]

Re: Backing up files
Posted by thomasking (68.92.xx.xx) on Thu 8 Sep 2005 at 08:17
really all i need is a backup of all the directories under /home done once every 2 days or so. I would also love to make a complete backup of the server (debian sarge 3.1) as I have gone to great lengths to set it up with all of the options and would hate to have to redo it.

right now I am running:
apache2
mysql
php4
phpbb2
postfix
courier
samba
jabber

on a windows intranet, mainly as a fileserver and IMAP email server. The company does not want internet access, and so I have made a hosts file and placed on all the windows boxes to point at a fictional FQDN, rather than run bind... that was giving me a headache.

I have a script that automatically backs up my MySQL databases and places it in a directory under /home and there are 6 user accounts under home that have their "My Documents" folders. Also I have one public shared directory "storage" at /home/storage. Mail is all stored under /home/vmail.

The only directory I want to automate backups on is /home

but I would love to figure out a way to duplicate this setup on another machine, to at least have a backup if this server fails... please forgive me, but I am running this server on a P3 Celeron 366 with 256mb ram and a 120gb hard drive. For the load that it will have on it, this is fine. I am running a base install, no GUI or extras.

[ Parent ]

Re: Backing up files
Posted by Anonymous (217.211.xx.xx) on Fri 10 Feb 2006 at 20:07
Intresting article... is this author a politician, because he doesn't say antything interesting at all.....

[ Parent ]