Thread (9 messages) 9 messages, 4 authors, 2011-01-15

Re: Backup Command

From: Hubert Kario <hidden>
Date: 2011-01-11 14:40:27

On Tuesday, January 11, 2011 15:33:38 Ivan Lab=C3=A1th wrote:
On 01/11/11 15:19, Hubert Kario wrote:
quoted
On Tuesday, January 11, 2011 14:54:38 Ivan Lab=C3=A1th wrote:
quoted
On 01/10/11 14:36, Hubert Kario wrote:
quoted
On Monday 10 of January 2011 14:25:32 Carl Cook wrote:
quoted
Here is my proposed cron:
=20
btrfs subvolume snapshot hex:///home
/media/backups/snapshots/hex-{DATE}
=20
rsync --archive --hard-links --delete-during --delete-excluded
--inplace --numeric-ids -e ssh
--exclude-from=3D/media/backups/exclude-hex hex:///home
/media/backups/hex
=20
btrfs subvolume snapshot droog:///home
/media/backups/snapshots/droog-{DATE}
=20
rsync --archive --hard-links --delete-during --delete-excluded
--inplace --numeric-ids -e ssh
--exclude-from=3D/media/backups/exclude-droog droog:///home
/media/backups/droog
=20
Comments?  Criticisms?
=20
This will make the dates associated with snapshots offset by how =
often
quoted
quoted
quoted
cron is run.
=20
In other words, if you run above script daily you will have data =
from
quoted
quoted
quoted
2011.01.01 in the hex-2011.01.02 directory.
=20
I do save the current date, do a LVM snapshot on the source, rsyn=
c
quoted
quoted
quoted
--inplace data over and do a local snapshot naming the folder usi=
ng the
quoted
quoted
quoted
saved date. This way the date in the name of backup directory is =
exact
quoted
quoted
quoted
to about a second.
=20
If you are mounting a LVM snapshot of an already mounted filesyste=
m,
quoted
quoted
would you be willing verify that it is really a snapshot that is
mounted?
=20
e.g. touch /mnt/live/its_alive && ls /mnt/snapshot/
=20
I am nearly willing to bet it is not a snapshot.
=20
well, by "LVM snapshot on the source" I meant:
1. do lvcreate --snapshot
2. mount newly created volume
3. use the new directory as the base for rsync
4. arrange umount and destruction of the snapshot after rsync compl=
etes
quoted
(no matter if it was successful)
=20
and this will in fact not make the "its_alive" visible in /mnt/snap=
shot
quoted
=20
You have to use this procedure if you use LVM snapshots for backup =
no
quoted
matter to where do you copy data. That's why I shortened it to a si=
ngle
quoted
point -- it's not the part that is important from btrfs perspective=
=2E
quoted
=20
Regards.
=20
The point I was trying to make is: it does not work with btrfs.
Try the above with a btrfs and you will be surprised.
If the source volume uses another filesystem, it should work properly=
=2E
=20
regards,
ivan
Yes, you are right, but I don't see a point in using LVM snapshots with=
 btrfs,=20
after all the ability to snapshot it on fs level is one of its defining=
=20
features...

--=20
Hubert Kario
QBS - Quality Business Software
02-656 Warszawa, ul. Ksawer=C3=B3w 30/85
tel. +48 (22) 646-61-51, 646-74-24
www.qbs.com.pl
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" =
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help