View previous topic :: View next topic |
Author |
Message |
my.Gentoo.Asus.Z87-A n00b
Joined: 11 Sep 2014 Posts: 7
|
Posted: Wed Oct 22, 2014 4:40 am Post subject: Using TAR to backup your Gentoo system |
|
|
Monitor progess with pv - [ monitor the progress of data through a pipe ]
SystemRescueCD has the pv package installed
Here's how i backup/restore my Gentoo system using tar with a progress bar in a SystemCD live environment:
Code: | BACKUP: tar cpf - . | pv -s $(du -sb . | awk '{print $1}') | gzip > <source location>/gentoo-img.tar.gz
RESTORE: pv <source location>/gentoo-img.tar.gz | tar xzpf - -C /mnt/gentoo |
Last edited by my.Gentoo.Asus.Z87-A on Thu Oct 23, 2014 10:07 am; edited 3 times in total |
|
Back to top |
|
|
my.Gentoo.Asus.Z87-A n00b
Joined: 11 Sep 2014 Posts: 7
|
Posted: Wed Oct 22, 2014 4:40 am Post subject: |
|
|
Naturally there are many other ways to do this - this is just one for the record... |
|
Back to top |
|
|
The Doctor Moderator
Joined: 27 Jul 2010 Posts: 2678
|
Posted: Wed Oct 22, 2014 5:16 am Post subject: |
|
|
Two major flaws with this script: Code: | echo "Removing old backups..."
rm /mnt/backup/backups/*.tar.gz | Removing old backups may be an important space saving step, but keeping exactly one backup is slightly problematic. What if the new backup fails? What if the new backup is corrupted? It would make far more sense to keep a number of backups. The coding for this would be slightly more complex, but much better from a backup point of view.
Also, what is the point of keeping backups on the same disk as the main system? If your disk fails it will take everything with it. _________________ First things first, but not necessarily in that order.
Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box. |
|
Back to top |
|
|
Roman_Gruber Advocate
Joined: 03 Oct 2006 Posts: 3846 Location: Austro Bavaria
|
Posted: Wed Oct 22, 2014 7:36 am Post subject: |
|
|
why not create a stage 4 and backup /home separately? on a regular basis? |
|
Back to top |
|
|
my.Gentoo.Asus.Z87-A n00b
Joined: 11 Sep 2014 Posts: 7
|
Posted: Wed Oct 22, 2014 1:16 pm Post subject: |
|
|
Changed "partitions/disks" to" disks" in the guide. Thanks for pointing out that slip
As i said above, this is just one way of doing a backup, of course there are others |
|
Back to top |
|
|
desultory Bodhisattva
Joined: 04 Nov 2005 Posts: 9410
|
Posted: Thu Oct 23, 2014 3:59 am Post subject: |
|
|
Nitro wrote: | Provide detailed information about what your tip or trick does, and how it works.
Note: Please do not merely link to another website. | A precis would be welcome. |
|
Back to top |
|
|
my.Gentoo.Asus.Z87-A n00b
Joined: 11 Sep 2014 Posts: 7
|
Posted: Thu Oct 23, 2014 10:07 am Post subject: |
|
|
All cleaned up |
|
Back to top |
|
|
steveL Watchman
Joined: 13 Sep 2006 Posts: 5153 Location: The Peanut Gallery
|
Posted: Thu Oct 23, 2014 2:21 pm Post subject: Re: Using TAR to backup your Gentoo system |
|
|
Quote: | Monitor progess with pv - [ monitor the progress of data through a pipe ]
SystemRescueCD has the pv package installed |
Hmm nice command; good to know about sys-apps/pv.
Code: | tar cpf - . | pv -s $(du -sb . | awk '{print $1}') | gzip > <source location>/gentoo-img.tar.gz |
Code: | .. pv -s "$(du -sb . | cut -f1)" | .. | should be a tiny bit quicker.
You should quote for robustness. |
|
Back to top |
|
|
|