Re: Skript for backup btrfs on external HD
Am 2014-11-29 um 23:18 schrieb Marc MERLIN: On Sat, Nov 29, 2014 at 10:51:08PM +0100, Jakob Schürz wrote: Am 2014-11-29 um 22:11 schrieb Marc MERLIN: On Sat, Nov 29, 2014 at 09:34:01PM +0100, Jakob Schürz wrote: Hi there! I made a script to do backup with btrfs on a external HD. You can see the function, how it works, and how it's to be used on my site http://linux.xundeenergie.at/doku.php?id=mkbtrbackup The site is in german. An english one will follow later. Do you want some explanations? Sure, how is it different from those 3? https://btrfs.wiki.kernel.org/index.php/Incremental_Backup#Available_Backup_Tools Wheter i haven't seen it, or this scripts can't do recursive backup... That's probably right, at least not automatically. And that's why i made the script. :) If you have subvolumes in subvolumes (for example: /home, /home/user1, /home/user2 /var, /var/spool, /var/lib are extra subvolumes IN the normal filetree from linux), my script takes them all. For me, they are all subvolumes also mounted on /mnt/btrfs_poolx so I backup from there. That's also possible with my skript, because you can control it with an config-file. For example you have / |-@ |-@home `-@var And you want all your snapshots of this 3 subvolumes in separate directories with timestamp (and maybe .hourly_X-Tag) put in the config: SNPMNT=/path/to/btrfs-poolmount BKPMNT=/path/to/external/HD/mountpoint backup @ roots backup/roots backup @home homes backup/homes backup @varvarsbackup/vars start the skript with mkbtrbackup create --interval hourly -c /path/to/backupconfig you get in /path/to/btrfs-poolmount 3 directories (roots, homes and vars), and on /path/to/external/HD/mountpoint one directoriy backup, including also the three given subdirectories from the 4th coloumn (leave this coloumn blank, no auto-transfer to the external HD!!!) in this subdirectories you get subvolumes like @.20141130-115001.hourly_0 @home.20141130-115001.hourly_0 @var.20141130-115001.hourly_0 AND they are rotated automatically. And my script changes the fstab-entry in the new snapshot. The original has the option subvol=@SUBVOL, where @SUBVOL is the name of the original system. I don't need to do that, my script updates a symlink pointing to the last snapshot, and you can use subvol=symlink-name I'm trying on this, it's not finished. There are many discussions about. What is better... modify grub.cfg on each snapshot, work with symlinks... I create one symlink @*.CURRENT. I will rename it to .LAST... so i can do the same with a static grub-entry You get a systemd-unit, in the tarball, which makes a snapshot from your system, on successful boot, so you can switch back fast, if an update destroyed your system. And it is for minimal-systems... no python, no perl, no java... only shell(bash) :-) That makes sense, thanks for explaining. For example... on an raspberry Pi it would be a good thing. :) Hope, you try it, and give me some feedback. ;-) Jakob -- To unsubscribe from this list: send the line unsubscribe linux-btrfs in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Skript for backup btrfs on external HD
Am 2014-11-29 um 22:11 schrieb Marc MERLIN: On Sat, Nov 29, 2014 at 09:34:01PM +0100, Jakob Schürz wrote: Hi there! I made a script to do backup with btrfs on a external HD. You can see the function, how it works, and how it's to be used on my site http://linux.xundeenergie.at/doku.php?id=mkbtrbackup The site is in german. An english one will follow later. Do you want some explanations? Sure, how is it different from those 3? https://btrfs.wiki.kernel.org/index.php/Incremental_Backup#Available_Backup_Tools Wheter i haven't seen it, or this scripts can't do recursive backup... If you have subvolumes in subvolumes (for example: /home, /home/user1, /home/user2 /var, /var/spool, /var/lib are extra subvolumes IN the normal filetree from linux), my script takes them all. It looks on the external storage, if there's an older snapshot (i call all subvolumes together in this case a snapshot!!) which is also on the local machine. If so, is makes a incremental backup. If not, a initial transfer is started. For each subvolume in the snapshot! And my script changes the fstab-entry in the new snapshot. The original has the option subvol=@SUBVOL, where @SUBVOL is the name of the original system. It changes the @SUBVOLUME to the subvolume-id, so you can mount your snapshot easy. One Point is missing... Modifying of grub to serve boot-menu-entries for older snapshots. You get a systemd-unit, in the tarball, which makes a snapshot from your system, on successful boot, so you can switch back fast, if an update destroyed your system. And it is for minimal-systems... no python, no perl, no java... only shell(bash) :-) regards jakob -- http://xundeenergie.at http://verkehrsloesungen.wordpress.com/ http://cogitationum.wordpress.com/ -- To unsubscribe from this list: send the line unsubscribe linux-btrfs in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Skript for backup btrfs on external HD
Hi there! I made a script to do backup with btrfs on a external HD. You can see the function, how it works, and how it's to be used on my site http://linux.xundeenergie.at/doku.php?id=mkbtrbackup The site is in german. An english one will follow later. Do you want some explanations? greetings jakob -- http://xundeenergie.at http://verkehrsloesungen.wordpress.com/ http://cogitationum.wordpress.com/ -- To unsubscribe from this list: send the line unsubscribe linux-btrfs in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Skript for backup btrfs on external HD
On Sat, Nov 29, 2014 at 09:34:01PM +0100, Jakob Schürz wrote: Hi there! I made a script to do backup with btrfs on a external HD. You can see the function, how it works, and how it's to be used on my site http://linux.xundeenergie.at/doku.php?id=mkbtrbackup The site is in german. An english one will follow later. Do you want some explanations? Sure, how is it different from those 3? https://btrfs.wiki.kernel.org/index.php/Incremental_Backup#Available_Backup_Tools Thanks, Marc -- A mouse is a device used to point at the xterm you want to type in - A.S.R. Microsoft is to operating systems what McDonalds is to gourmet cooking Home page: http://marc.merlins.org/ | PGP 1024R/763BE901 -- To unsubscribe from this list: send the line unsubscribe linux-btrfs in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html