Backing up messages from KMail
David Fletcher
dave at thefletchers.net
Tue Sep 8 10:00:52 UTC 2009
On Tuesday 08 September 2009 10:39:04 Georgi Kourtev wrote:
> > Why just kmail?
> >
> > I use a little script to back up the entire /home/ directory to a tar
> > file, plus a few other bits and pieces. Works for me - when I restore the
> > backup to a new PC/hard drive, everything is as it was before.
> >
> > Dave
>
> Dave,
>
> Excellent. Can you share it with ones that are less advanced :)? Thanks.
> gk
I'm not sure that I'd apply the term "advanced" to myself.
OK here's my script:-
#! /bin/bash
# Local etc directory
rsync -av --delete /etc/ /home/dave/backups/copyoflocalslashetc/
tar cvpfz /root/home`date
+%Y%m%d%H%M`.tar.gz --exclude=Cache --exclude=.googleearth --exclude=.thumbnails /home/*
The line with the tar command has been split by my kmail. Remember to join it
up again.
I also have in there, a couple of sections for backing up configs from my home
server over the network which I've cut for simplicity.
Try using
man rsync
man tar
and
man date
to get a bit of an understanding of what's going on here, and especially find
out about the action of the back tick characters surrounding the embedded
date command.
Note that the copy of /etc is used to restore the system. More about this
later.
I save this script as file /home/backup then it keeps itself backed up also.
Remember to set the executable property on the file and run it as sudo.
Dave
More information about the kubuntu-users
mailing list