Linux/Backup: Difference between revisions

From Wiki
No edit summary
No edit summary
 
(12 intermediate revisions by the same user not shown)
Line 8: Line 8:
</blockquote>
</blockquote>


* gzip image ohne dd
* gzip image without dd
<blockquote>
<blockquote>
<pre>
<pre>
Line 15: Line 15:
</blockquote>
</blockquote>


* bootloader
<blockquote>
<pre>
dd if=/dev/sda of=bootloader.img bs=446 count=1
</pre>
</blockquote>


* MBR + partitiontable
<blockquote>
<pre>
fdisk -lu
dd if=/dev/sda of=mbr.img bs=512? count=1? 63?
</pre>
</blockquote>


=== Backup over network ===
* Target
<blockquote>
<pre>
netcat -l 5555 | dd of=image.dd.gz
</pre>
</blockquote>
* Source
<blockquote>
<pre>
dd if=/dev/sda | pv | pigz --best | netcat $TargetIP 5555
</pre>
</blockquote>
=== Status ===
* dd status
* dd status
<blockquote>
<blockquote>
<pre>
<pre>
while /bin/true; do sleep 5; kill -USR1 `pidof dd`; done
while /bin/true; do sleep 5; kill -USR1 `pidof dd`; done
</pre>
</blockquote>


oder
:: or


<blockquote>
<pre>
watch -n N kill -USR1 `pidof dd`  
watch -n N kill -USR1 `pidof dd`  
</pre>
</pre>
</blockquote>
</blockquote>
* pv
<blockquote>
<pre>
dd if=/dev/sda | pv | dd of=image.dd
pv -s 60G    -> for estimate
</pre>
</blockquote>
=== Loop ===
* mount image as loop
<blockquote>
<pre>
mkdir /mnt/loop
mount -o loop image.dd /mnt/loop
umount /mnt/loop
</pre>
</blockquote>
== rsync ==
<blockquote>
<pre>
rsync -v -P -r --delete --bwlimit=10000 /mnt/vm-host_backup/05_vm-host /mnt/backup
</pre>
</blockquote>


=== other ===
=== other ===
Line 35: Line 98:
</pre>
</pre>
</blockquote>
</blockquote>
== Backup Manager ==
* /backup      (ln /filesystem/80_backup/10_autobackup)
* /backup/!backupmanager
* /backup/10_vm-host
== Backup Software ==
* BackupPC (1M+, 31*
* Duplicity (500k+, 14*)
* Duplicati (10M+, 139*)
* Borg (1M+, 16*)
* Bacula
* Restic (10M+, 16*)
* UrBackup (5M+, 23*)
* BackupNinja


== Links ==
== Links ==
Line 44: Line 124:
* http://forums.veeam.com/viewtopic.php?p=51838
* http://forums.veeam.com/viewtopic.php?p=51838
* http://www.mattcutts.com/blog/backup-gmail-in-linux-with-getmail/ (Backup pop/imap account)
* http://www.mattcutts.com/blog/backup-gmail-in-linux-with-getmail/ (Backup pop/imap account)
* http://www.myslug.de/index.php?title=Backupmaschine
[[Category:Linux/Bash]]
[[Category:Linux]]

Latest revision as of 06:12, 15 June 2020

DD

Backup

  • simple backup to image file
dd if=/dev/sda | gzip > image.dd.gz
  • gzip image without dd
gzip -c < /dev/hda1 > /tmp/partition_image.gz
  • bootloader
dd if=/dev/sda of=bootloader.img bs=446 count=1
  • MBR + partitiontable
fdisk -lu
dd if=/dev/sda of=mbr.img bs=512? count=1? 63?

Backup over network

  • Target
netcat -l 5555 | dd of=image.dd.gz


  • Source
dd if=/dev/sda | pv | pigz --best | netcat $TargetIP 5555

Status

  • dd status
while /bin/true; do sleep 5; kill -USR1 `pidof dd`; done
or
watch -n N kill -USR1 `pidof dd` 
  • pv
dd if=/dev/sda | pv | dd of=image.dd

pv -s 60G    -> for estimate

Loop

  • mount image as loop
mkdir /mnt/loop
mount -o loop image.dd /mnt/loop
umount /mnt/loop

rsync

rsync -v -P -r --delete --bwlimit=10000 /mnt/vm-host_backup/05_vm-host /mnt/backup



other

  • dd random
dd if=/dev/random bs=1M count=256 | gzip >./256-MB-random-data.bin


Backup Manager

  • /backup (ln /filesystem/80_backup/10_autobackup)
  • /backup/!backupmanager
  • /backup/10_vm-host

Backup Software

  • BackupPC (1M+, 31*
  • Duplicity (500k+, 14*)
  • Duplicati (10M+, 139*)
  • Borg (1M+, 16*)
  • Bacula
  • Restic (10M+, 16*)
  • UrBackup (5M+, 23*)
  • BackupNinja


Links