Download presentation
Presentation is loading. Please wait.
Published byAlbert Cain Modified over 8 years ago
1
Simple Backup Methods Jon Larsen Omaha Linux User Group March 7th, 2006
2
Simple Backups? Protecting your data is very important. There are several backup methods under Linux/UNIX we can be used to protect your data. We will discuss a few of the simple, common tools.
3
Utilites Covered in this presentation tar rsync netcat dd unison
4
tar ● Originally designed for sequential tape devices for backup purposes ● Has been extended to use to use the -f option for files ● Compression capabilities added (-z, -Z and -j) ● Unix Pipes can also be used ● Man tar ● http://en.wikipedia.org/wiki/Tar_(file_format)
5
Backup a directory ● In it's simplest form – tar -czf filename.tar.gz /home/username ● c – create ● z – gzip ● f - filename ● /home/user – 'source'
6
Alternate ● Using bzip2 – tar -cjP -–preserve -f filename.tar.bz2 /home/username – c – create – j – bzip2 – P – don't strip leading '/' from paths – --preserve – preserve file permissions – f - file
7
Simple Tape Drive Backup #!/bin/bash DATE=`date '+%Y%m%d'` tar -cv –blocking-factor 64 –label=Home$DATE –tape-length 156250000 –exclude /proc –totals -f /dev/st0 /
8
Restore tar ● Restore backup – tar -xjf filename.tar.bz2 – tar -xzf filename.tar.gz – tar --blocking-factor=64 --tape-length 156250000 -xvf /dev/st0 home/username/file
9
rsync ● rsync is a computer program which synchronizes files and directories from one location to another ● mirroring takes place with only one transmission in each direction ● ssh tunnel ● http://en.wikipedia.org/wiki/Rsync
10
rsync example ● rsync -avz –delete -e “ssh -l username” username@192.168.0.1:/home/use rname /home/username ● Use ssh tunnel for encryption – a - archive – v - verbose – z - compress
11
netcat ● In computing, netcat is a network utility for reading from and writing to network connections on either TCP or UDP. It is designed in a thin and simple way, which makes it easy to incorporate in larger applications. Because of its versatility, netcat is also called the "TCP/IP Swiss Army knife". ● http://en.wikipedia.org/wiki/Netcat
12
Netcat example ● Create a listener ● nc -l -p 8000 | tar -xP –preserve ● Create the sender ● tar czp –preserve / | nc 192.168.0.1:8000
13
dd ● dd is a common Unix program whose primary purpose is the low- level copying and conversion of files. ● http://en.wikipedia.org/wiki/Dd_(Unix)
14
dd example ● Backup a hard drive (duplicate) ● dd if=/dev/hda of=/dev/hdb
15
unison ● Unison is a file synchronization program for Unix (including Linux, Mac OS X, and Solaris) and Windows used for synchronizing files and directories on multiple computers. ● http://en.wikipedia.org/wiki/Unison_(file_synchronizer)
16
unison
17
Advanced Solutions ● Bacula – http://www.bacula.org/ ● Amanda – http://www.amanda.org/
18
Open Discussion
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.