Home Directory

David Fletcher dave at thefletchers.net
Sat Dec 6 10:31:51 UTC 2008


On Saturday 06 Dec 2008, Robert Parker wrote:
> On Sat, Dec 6, 2008 at 6:57 AM, Steven Vollom
> <stevenvollom at sbcglobal.net> wrote:
> 
> >> If you have done any system wide changes ie edited any of the files in
> >> /etc you might want to look at backing up /etc
> >>
> > I don't know how to edit anything yet, if it means changing instructions
> > using a Konsole.
> 
> Ok chances are that you don't need to worry about backing up /etc
> 
> Bob
> -- 
> In a world without walls who needs Windows (or Gates)? Try Linux instead!
> 
> -- 
> kubuntu-users mailing list
> kubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/kubuntu-users
> 

Here is my backup script, if it's of use to anybody.

I keep a backup of my /etc directories, not to put them back exactly as they 
were, but so that I can look back at them when I upgrade to the next version 
of the OS and see what tricks I did to make things work the way I wanted 
before.

Anybody who wants to keep and use the lines to back up files from another 
machine (the server) will need to use the copy public ssh key 
to /root/.ssh/authorized_keys on the other machine trick to make it work 
smoothly. And no, I've not set a root password to do this.

Dave


#! /bin/bash

# Local etc directory
rsync -av --delete /etc/ /home/dave/backups/copyoflocalslashetc/

# server /etc directory
# Make sure it's alve and kicking first!
if ping -c1 -w2 server </dev/null &>/dev/null
then
  sudo -u dave rsync -av --delete 
root at server:/etc/ /home/dave/backups/copyofserverslashetc/
fi

# server /var/mail directory
# Make sure it's alve and kicking first!
if ping -c1 -w2 server </dev/null &>/dev/null
then
  sudo -u dave rsync -av --delete 
root at server:/var/mail/ /home/dave/backups/copyofserverslashvarslashmail/
fi

aptitude search '~i !~M' | tr -s ' ' | cut -f 2 -d ' ' 
> /home/dave/backups/AppsInstalledList.txt

tar cvpfz /root/home`date 
+%Y%m%d%H%M`.tar.gz --exclude=Cache --exclude=.googleearth --exclude=.thumbnails /home/*

# Nothing to back up from /var/spool/mail/ with the server
#tar cvfz /root/var_spool_mail`date +%Y%m%d%H%M`.tar.gz /var/spool/mail/*

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.ubuntu.com/archives/kubuntu-users/attachments/20081206/49ceecd0/attachment.sig>


More information about the kubuntu-users mailing list