Durrett Hwk 1

Durrett Hwk 1 - Tasha Phan ISQS 3351 Homework 1 1 Backup...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Tasha Phan ISQS 3351 Homework 1 1. Backup $Home/bin and optionally sends to remote host #!/bin/sh #< Backup $HOME/bin and optionally send to remote host _FILE=/files/backup/bin_`date +%d%b%y`_$$.tar if [ "$#" -gt "2" ]; then echo "USAGE: `basename $0` [-z] [-r]" echo " -z gzip backup file" echo " -r copy to remote server" exit 1 fi _GZIP="" _REMOTE="" while : do case $1 in "-z" ) _GZIP="y" shift ;; "-r" ) _REMOTE="y" if [ `id -u` != 0 ]; then fi if [ "$?" -ne 0 ]; then fi shift ;; * ) break ;; esac done tar cvf $_FILE /home/kevin/bin echo "tar to $_FILE complete!" echo "*********************************" if [ "$_GZIP" = "y" ]; then gzip $_FILE echo "gzip to $_FILE.gz complete!" echo "*********************************" fi if [ "$_REMOTE" = "y" ]; then if [ "$_GZIP" = "y" ]; then
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
_FILE_TO_COPY=${_FILE}.gz else _FILE_TO_COPY=${_FILE} fi smbmount //xpserver/i$ /bk_mnt cd /bk_mnt/_backup cp $_FILE_TO_COPY . echo "Remote file transfer complete!" echo "*********************************" cd /home/kevin/bin ls -lt /bk_mnt/_backup | head -2 | tail -1 smbumount /bk_mnt fi echo "BACKUP COMPLETE!" exit 0 2. Remounts /dev/sda1 and chance ownership and permissions so that Tasha can
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 5

Durrett Hwk 1 - Tasha Phan ISQS 3351 Homework 1 1 Backup...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online