From 021ba5020a62cf219d85822842292c3a1dc39e0c Mon Sep 17 00:00:00 2001 From: "Martin A. Brown" Date: Wed, 27 Jan 2016 17:03:59 -0800 Subject: [PATCH] repositioning a closing --- LDP/guide/docbook/Bash-Beginners-Guide/chap7.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LDP/guide/docbook/Bash-Beginners-Guide/chap7.xml b/LDP/guide/docbook/Bash-Beginners-Guide/chap7.xml index 7a3a8cc8..184a1625 100644 --- a/LDP/guide/docbook/Bash-Beginners-Guide/chap7.xml +++ b/LDP/guide/docbook/Bash-Beginners-Guide/chap7.xml @@ -635,8 +635,8 @@ esac Modify /etc/profile so that you get a special greeting message when you connect to your system as root. Edit the leaptest.sh script from so that it requires one argument, the year. Test that exactly one argument is supplied. Write a script called whichdaemon.sh that checks if the httpd and init daemons are running on your system. If an httpd is running, the script should print a message like, This machine is running a web server. Use ps to check on processes. -Write a script that makes a backup of your home directory on a remote machine using scp. The script should report in a log file, for instance ~/log/homebackup.log. If you don't have a second machine to copy the backup to, use scp to test copying it to the localhost. This requires SSH keys between the two hosts, or else you have to supply a password. The creation of SSH keys is explained in man ssh-keygen. -Adapt the script from the first example in to include the case of exactly 90% disk space usage, and lower than 10% disk space usage. +Write a script that makes a backup of your home directory on a remote machine using scp. The script should report in a log file, for instance ~/log/homebackup.log. If you don't have a second machine to copy the backup to, use scp to test copying it to the localhost. This requires SSH keys between the two hosts, or else you have to supply a password. The creation of SSH keys is explained in man ssh-keygen. +Adapt the script from the first example in to include the case of exactly 90% disk space usage, and lower than 10% disk space usage. The script should use tar for the creation of the backup and gzip or bzip2 for compressing the .tar file. Put all filenames in variables. Put the name of the remote server and the remote directory in a variable. This will make it easier to re-use the script or to make changes to it in the future. The script should check for the existence of a compressed archive. If this exists, remove it first in order to prevent output generation. The script should also check for available diskspace. Keep in mind that at any given moment you could have the data in your home directory, the data in the .tar file and the data in the compressed archive all together on your disk. If there is not enough diskspace, exit with an error message in the log file.