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.
[ Parent | Reply to this comment ]
[ Send Message | View Steve's Scratchpad | 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 | Reply to this comment ]
this would be a simple thing to do and this is supposed to be a forum for newbies, eh?
[ Parent | Reply to this comment ]
[ Send Message | View Steve's Scratchpad | View Weblogs ]
There have been several pieces on backups, including:
- Question: Making efficient backups on Debian?
- Unattended, Encrypted, Incremental Network Backups:
- Simple rotated backups with rsnapshot
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 | Reply to this comment ]
[ Parent | Reply to this comment ]
[ Send Message | View Steve's Scratchpad | 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 | Reply to this comment ]
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 | Reply to this comment ]
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 | Reply to this comment ]
[ Parent | Reply to this comment ]