|
1881.
|
|
|
There are many ways to backup a Ubuntu installation. The most import thing about backups is to develop a <emphasis>backup plan</emphasis> consisting of what to backup, where to backup it up to, and how to restore it.
|
|
|
|
(no translation yet)
|
|
|
|
1882.
|
|
|
The following sections discuss various ways of accomplishing these tasks.
|
|
|
|
Nasledujúce časti hovoria o rôznych spôsoboch, akými tieto úlohy vykonať.
|
|
Translated and reviewed by
Peter Mráz
|
|
|
|
Located in
serverguide/C/backups.xml:18(para)
|
|
1883.
|
|
|
Shell Scripts
|
|
|
|
Shell skripty
|
|
Translated and reviewed by
Peter Mráz
|
|
|
|
Located in
serverguide/C/backups.xml:22(title)
|
|
1884.
|
|
|
One of the simplest ways to backup a system is using a <emphasis>shell script</emphasis>. For example, a script can be used to configure which directories to backup, and use those directories as arguments to the <application>tar</application> utility creating an archive file. The archive file can then be moved or copied to another location. The archive can also be created on a remote file system such as an <emphasis>NFS</emphasis> mount.
|
|
|
|
Jedným z najjednoduchších spôsobov, akým sa dá zálohovať systém, je použitie tzv. <emphasis>shell skriptov</emphasis> - skriptov pre príkazový riadok. Pomocou takéhoto skriptu môžeme nastaviť, ktoré priečinky sa majú zálohovať a obsah týchto priečinkov môžeme skomprimovať (zbaliť) pomocou nástroja <application>tar</application> do archívu. Archív je súbor, ktorý potom môžeme skopírovať na iné miesto. Môžeme ho vytvoriť aj na vzdialenom súborovom systéme, ktorý pripojíme pomocou systému <emphasis>NFS</emphasis>.
|
|
Translated and reviewed by
Peter Mráz
|
|
|
|
Located in
serverguide/C/backups.xml:23(para)
|
|
1885.
|
|
|
The <application>tar</application> utility creates one archive file out of many files or directories. <application>tar</application> can also filter the files through compression utilities reducing the size of the archive file.
|
|
|
|
Nástroj <application>tar</application> dokáže vytvoriť jeden archívny súbor z veľkého množstva súborov a priečinkov. Nástroj <application>tar</application> tiež zredukuje priestor potrebný na uchovanie archívu prostredníctvom kompresie.
|
|
Translated and reviewed by
Peter Mráz
|
|
|
|
Located in
serverguide/C/backups.xml:29(para)
|
|
1886.
|
|
|
Simple Shell Script
|
|
|
|
Jednoduchý skript
|
|
Translated and reviewed by
Peter Mráz
|
|
|
|
Located in
serverguide/C/backups.xml:35(title)
|
|
1887.
|
|
|
The following shell script uses <application>tar</application> to create an archive file on a remotely mounted NFS file system. The archive filename is determined using additional command line utilities.
|
|
|
|
Nasledujúci skript použije nástroj <application>tar</application> na vytvorenie archívu na vzdialenom súborovom systéme, ktorý je pripojený pomocou systému NFS. Meno súboru s archívom sa odvodí od dátumu a názvu počítača.
|
|
Translated and reviewed by
Peter Mráz
|
|
|
|
Located in
serverguide/C/backups.xml:36(para)
|
|
1888.
|
|
|
![](/@@/translation-newline)
#!/bin/sh ![](/@@/translation-newline)
#################################### ![](/@@/translation-newline)
# ![](/@@/translation-newline)
# Backup to NFS mount script. ![](/@@/translation-newline)
# ![](/@@/translation-newline)
####################################
![](/@@/translation-newline)
# What to backup. ![](/@@/translation-newline)
backup_files="/home /var/spool/mail /etc /root /boot /opt"
![](/@@/translation-newline)
# Where to backup to. ![](/@@/translation-newline)
dest="/mnt/backup"
![](/@@/translation-newline)
# Create archive filename. ![](/@@/translation-newline)
day=$(date +%A) ![](/@@/translation-newline)
hostname=$(hostname -s) ![](/@@/translation-newline)
archive_file="$hostname-$day.tgz"
![](/@@/translation-newline)
# Print start status message. ![](/@@/translation-newline)
echo "Backuping up $backup_files to $dest/$archive_file" ![](/@@/translation-newline)
date ![](/@@/translation-newline)
echo
![](/@@/translation-newline)
# Backup the files using tar. ![](/@@/translation-newline)
tar czf $dest/$archive_file $backup_files
![](/@@/translation-newline)
# Print end status message. ![](/@@/translation-newline)
echo ![](/@@/translation-newline)
echo "Backup finished" ![](/@@/translation-newline)
date
![](/@@/translation-newline)
# Long listing of files in $dest to check file sizes. ![](/@@/translation-newline)
ls -lh $dest
|
|
|
represents a line break.
Start a new line in the equivalent position in the translation.
|
|
|
represents a space character.
Enter a space in the equivalent position in the translation.
|
|
|
|
(no translation yet)
|
|
|
|
1889.
|
|
|
<emphasis>$backup_files:</emphasis> a variable listing which directories you would like to backup. The list should be customized to fit your needs.
|
|
|
|
<emphasis>$backup_files:</emphasis> premenná, ktorá obsahuje zoznam priečinkov, ktoré sa majú zálohovať. Tento zoznam si môžeme upraviť podľa našich potrieb.
|
|
Translated and reviewed by
Peter Mráz
|
|
|
|
Located in
serverguide/C/backups.xml:77(para)
|
|
1890.
|
|
|
<emphasis>$day:</emphasis> a variable holding the day of the week (Monday, Tuesday, Wednesday, etc). This is used to create an archive file for each day of the week, giving a backup history of seven days. There are other ways to accomplish this including other ways using the <application>date</application> utility.
|
|
|
|
<emphasis>$day:</emphasis> premenná, ktorá obsahuje deň v týždni (Pondelok, Utorok, Streda, atď.). Táto premenná sa používa na vytvorenie archívu pre každý deň v týždni, čo nám poskytne sedem dňovú históriu archívov. Meno archívu môžeme vytvoriť aj inými spôsobmi. Napríklad môžeme využiť nástroj <application>date</application>.
|
|
Translated and reviewed by
Peter Mráz
|
|
|
|
Located in
serverguide/C/backups.xml:83(para)
|