Linux Newbie help
 help / color / mirror / Atom feed
From: Don Petrowski <dpetrowski@ci.collierville.tn.us>
To: Paul Kraus <pkraus@pelsupply.com>
Cc: linux-newbie@vger.kernel.org
Subject: Re: Bash Scripts
Date: 10 Oct 2002 16:33:16 -0500	[thread overview]
Message-ID: <1034285597.3495.8.camel@workwatcher> (raw)
In-Reply-To: <003301c2709c$7ac11b00$64fea8c0@pkrausxp>

[-- Attachment #1: Type: text/plain, Size: 952 bytes --]

Here is an example of a simple backup script I use to backup some files
and copy them to another machine to be put on tape.

echo $HOSTNAME > /var/log/backup.log
echo "Backup Started: " >> /var/log/backup.log
date >> /var/log/backup.log
tar --create --verbose --bzip2 --file /root/tuxtracker.tar.bz2 --files-from /etc/backup-list --exclude-from /etc/backup-exclude >> /var/log/backup.log 2>&1
echo "Backup Stoped: " >> /var/log/backup.log
date >> /var/log/backup.log
echo "Transfer to Annex Started: " >> /var/log/backup.log
date >> /var/log/backup.log
if scp -q /root/tuxtracker.tar.bz2 tuxtracker@192.168.0.253:. >> /var/log/backup.log 2>&1
then
   echo "Transfer to Annex Finished Successfully: " >> /var/log/backup.log
   date >> /var/log/backup.log
else
   echo "Transfer to Annex was Interrupted: " >> /var/log/backup.log
   date >> /var/log/backup.log
fi

The first line creates a log file and all other lines append to it.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 240 bytes --]

      parent reply	other threads:[~2002-10-10 21:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-10 20:34 Bash Scripts Paul Kraus
2002-10-10 21:13 ` Don Petrowski
2002-10-10 21:16 ` Ray Olszewski
2002-10-10 21:33 ` Don Petrowski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1034285597.3495.8.camel@workwatcher \
    --to=dpetrowski@ci.collierville.tn.us \
    --cc=linux-newbie@vger.kernel.org \
    --cc=pkraus@pelsupply.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox