Re: backup snapshot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/11/2015 10:52 AM, Diogene Laerce wrote:
Hi Rick,

Le 11/08/2015 19:18, Rick Stevens a écrit :
On 08/11/2015 09:18 AM, Chris Murphy wrote:
On Tue, Aug 11, 2015 at 3:05 AM, Diogene Laerce <me_buss777@xxxxxxxx>
wrote:

https://wiki.archlinux.org/index.php/Full_System_Backup_with_rsync

Is there a trick I don't see here ? Because if the backup of those
directories
is enough for a full restoration of a system state, this method is
far more
efficient than the others, isn't it ? As one does not need to reboot
and
just have
to make a script or/and a cron job to make his own snapshot.

I don't consider a backup and snapshot to be the same thing. Copying
(or rsyncing) some directories to another volume is a backup. A
snapshot is a deduplicated copy of something at a particular moment in
time, on the same volume or storage pool. It's not a backup, in that
if the pool implodes both the original and snapshot are lost. A
snapshot can be used as a source for a backup, since you can make a
snapshot that doesn't change while the backup is happening.

I agree with Chris. Snapshots are ways of restoring data that has been
perhaps corrupted or deleted or going back in time to some earlier
point in the filesystems' life. They aren't backups.

Backup philosophies and techniques vary depending on what you need for
your unique situation. I'm not claiming what I do is the best, but this
is what works for me:

On the last Friday of a month, I plug in a big ESATA or USB3 drive and
use it to store the output of Mondo Rescue. I have the backup in the
form of DVD-sized ISO images I can burn DVDs from and there is a
recovery DVD you can boot from. That gives me a backup usable to
restore to bare metal.

Once a week (or more often if there's been significant changes), I use
a _different_ ESATA or USB3 drive and run an rsync that backs up
everything except a few things (/proc, /sys, /dev, /media,
/var/log/journal, various caches, etc.) to a directory on that external
drive based on the hostname and date I ran the backup. That permits me
to restore data that's a bit more recent than the MondoRescue stuff.

I'd be happy to share the MondoArchive and rsync scripts if you wish.
Tweak to suit your needs.

Thank you for the offer.

I'm going to stick with RedoBackup but I'd really like to have a look at
your rsync scripts, and maybe at what various caches you think of.

The rsync backup is done via this script:

---------------------- CUT HERE --------------------------------------
#!/bin/bash
# Back up system to a specific directory given on the command line. Excludes
# the /proc, /sys, /dev and /media directories
MYHOST=`hostname`
TODAY=`date +%d-%b-%Y`
if [ $# -lt 1 ]; then
    TGT="/media/500GB-Drive/Backups/$MYHOST-BackUp-$TODAY"
    OPT=""
else
    TGT="$1/$MYHOST-BackUp-$TODAY"
    OPT="--exclude=$1/***"
fi

nice -n 19 /bin/rsync -avXA --exclude-from=/etc/skipdirs.rsync $OPT / $TGT
---------------------- CUT HERE --------------------------------------

And the "/etc/skipdirs.rsync" file is:

---------------------- CUT HERE --------------------------------------
/proc/*
/sys/*
/dev/*
/media/**
/var/log/journal/*
/BACKUPS/***
**/.cache/google-chrome/***
**/.ccache/***
/run/media/**
var/lib/docker/*
---------------------- CUT HERE --------------------------------------

Obviously, change the "TGT" bit to reflect where your drive is
located and modify the skipdirs.rsync file to reflect your needs.

As far as the mondoarchive stuff:

---------------------- CUT HERE --------------------------------------
#!/bin/bash
# runmondoarchive.sh - Run mondoarchive with standard options

# Only allow this script to be run as the root user...
if [ $EUID -ne 0 ]; then
    echo "This script must be run as the root user. Exiting."
    exit 1
fi

# Grab this host's name...
THISHOST=`hostname -s`

# Get the date as mm-dd-yyyy...
DT=`date +%m-%d-%Y`

# Say where the images are to be saved...
DEST=/media/1TB-Drive/Backups/MondoImages

# Scratch directory...
SCR=/tmp/mondoscratch
if [ ! -d $SCR ]; then
    mkdir -p $SCR
fi

# Temp directory...
TMP=/tmp/mondotemp
if [ ! -d $TMP ]; then
    mkdir -p $TMP
fi

# Set how big the images can be...
#SZ=640m			# CD/CD-R
SZ=4480m			# DVD/DVD-R

# Call MondoArchive. Arguments are:
#
#   -O				Back up the host
#				(you can add "-V" to verify images
#				against the current filesystem)
#   -i				Create ISO files
#   -p $THISHOST-$DT		Specify the prefix each ISO image will
#				have (hostname-dd-mm-yyyy)
#   -I "/"			Back up EVERYTHING from the root on down
#   -E "/media"			Do NOT back up anything in "/media"
#   -d $DEST			Destination where ISO images will go
#   -s $SZ			Set the maximum size of each ISO image
#   -S $SCR			Set scratch directory (where ISOs are
#				built)
#   -T $TMP			Set temporary working directory
#   -z				Archive extended attributes of files
CMD="mondoarchive -O -i -p ${THISHOST}-${DT} -I \"/\" -E \"/media\" -d ${DEST} -s ${SZ} -z"
echo -e "About to run:\n\t$CMD"
$CMD
---------------------- CUT HERE --------------------------------------

Again, modify as you see fit.
----------------------------------------------------------------------
- Rick Stevens, Systems Engineer, AllDigital    ricks@xxxxxxxxxxxxxx -
- AIM/Skype: therps2        ICQ: 226437340           Yahoo: origrps2 -
-                                                                    -
-   I haven't lost my mind.  It's backed up on tape somewhere, but   -
-                       probably not recoverable.                    -
----------------------------------------------------------------------
--
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux