|
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)
|
|
1891.
|
|
|
<emphasis>$hostname:</emphasis> variable containing the <emphasis>short</emphasis> hostname of the system. Using the hostname in the archive filename gives you the option of placing daily archive files from multiple systems in the same directory.
|
|
|
|
<emphasis>$hostname:</emphasis> premenná, ktorá obsahuje <emphasis>krátky</emphasis> názov stanice. Vďaka tomuto menu rozoznáme, z ktorého počítača záloha pochádza, v prípade, že na rovnaké miesto ukladáme zálohy z viacerých počítačov.
|
|
Translated and reviewed by
Peter Mráz
|
|
|
|
Located in
serverguide/C/backups.xml:90(para)
|
|
1892.
|
|
|
<emphasis>$archive_file:</emphasis> the full archive filename.
|
|
|
|
<emphasis>$archive_file:</emphasis> celé meno súboru s archívom.
|
|
Translated and reviewed by
Peter Mráz
|
|
|
|
Located in
serverguide/C/backups.xml:97(para)
|
|
1893.
|
|
|
<emphasis>$dest:</emphasis> destination of the archive file. The directory needs to be created and in this case <emphasis>mounted</emphasis> before executing the backup script. See <xref linkend="network-file-system"/> for details using <emphasis>NFS</emphasis>.
|
|
|
|
<emphasis>$dest:</emphasis> priečinok, do ktorého sa má archív uložiť. Tento priečinok je potrebné pred použitím skriptu vytvoriť a v našom prípade aj <emphasis>pripojiť</emphasis> pomocou NFS. Viac informácií o <emphasis>NFS</emphasis> sa nachádza v časti <xref linkend="network-file-system"/>.
|
|
Translated and reviewed by
Peter Mráz
|
|
|
|
Located in
serverguide/C/backups.xml:102(para)
|
|
1894.
|
|
|
<emphasis>status messages:</emphasis> optional messages printed to the console using the <application>echo</application> utility.
|
|
|
|
<emphasis>stavové správy:</emphasis> toto sú voliteľné správy, ktoré sa vypíšu pomocou nástroja <application>echo</application> na počítači, aby používateľ vedel, čo sa na počítači deje.
|
|
Translated and reviewed by
Peter Mráz
|
|
|
|
Located in
serverguide/C/backups.xml:109(para)
|
|
1895.
|
|
|
<emphasis>tar czf $dest/$archive_file $backup_files:</emphasis> the <application>tar</application> command used to create the archive file.
|
|
|
|
<emphasis>tar czf $dest/$archive_file $backup_files:</emphasis> príkaz <application>tar</application> sa využíva na vytvorenie archívu.
|
|
Translated and reviewed by
Peter Mráz
|
|
|
|
Located in
serverguide/C/backups.xml:115(para)
|
|
1896.
|
|
|
<emphasis>c:</emphasis> creates an archive.
|
|
|
|
<emphasis>c:</emphasis> vytvorí archív.
|
|
Translated and reviewed by
Peter Mráz
|
|
|
|
Located in
serverguide/C/backups.xml:121(para)
|
|
1897.
|
|
|
<emphasis>z:</emphasis> filter the archive through the <application>gzip</application> utility compressing the archive.
|
|
|
|
<emphasis>z:</emphasis> použije kompresiu <application>gzip</application>.
|
|
Translated and reviewed by
Peter Mráz
|
|
|
|
Located in
serverguide/C/backups.xml:126(para)
|