From dexter.psych.umn.edu!rob Thu Jan 13 09:45:39 1994
Received: from VX.CIS.UMN.EDU ([128.101.63.1]) by viz.tamu.edu with SMTP id <12823>; Thu, 13 Jan 1994 09:45:27 -0600
Received: from dexter.psych.umn.edu by VX.CIS.UMN.EDU (PMDF V4.2-13 #2574) id
 <01H7MOEBZ4EODBI2JS@VX.CIS.UMN.EDU>; Thu, 13 Jan 1994 09:47:05 CDT
Received: by dexter.psych.umn.edu; Thu, 13 Jan 94 09:39:53 -0600
Date:	Thu, 13 Jan 1994 09:39:53 -0600
From:	Robert Stephens <rob@dexter.psych.umn.edu>
To:	sgi-faq@viz.tamu.edu
Message-id: <9401131539.AA27404@dexter.psych.umn.edu>
Content-transfer-encoding: 7BIT
Status: RO



I enjoy your SGI faq very much, and I thought the following might be
useful to include in the SGI-admin FAQ.  These are responses I received
after posting for info on how to use crontab to automate a tape
backup.  I guess you can decide which one works best.  Keep up the good
work.

-----CUT HERE------

>From msweet@Spock.ctr.nawcad.navy.mil  Tue Jan 11 18:09:34 1994
Received: from spock.ctr.nawcad.navy.mil by dexter.psych.umn.edu; Tue, 11 Jan 94 18:09:34 -0600
Received: by Spock.ctr.nawcad.navy.mil (920330.SGI/921111.SGI.AUTO.ANONFTP)
	for rob@dexter.psych.umn.edu id AA19557; Tue, 11 Jan 94 19:14:03 -0500
Date: Tue, 11 Jan 94 19:14:03 -0500
From: msweet@Spock.ctr.nawcad.navy.mil (Michael Sweet)
Posted-Date: Tue, 11 Jan 94 19:14:03 -0500
Message-Id: <9401120014.AA19557@Spock.ctr.nawcad.navy.mil>
To: Robert Stephens <rob@dexter>
Subject: Re:  Automated backups with crontab?
Status: RO

I have a script that uses BRU to do backups every night; I've added it to the
bottom of this message.

In the root crontab file, add the line:

    0       1       *       *       *       /bin/csh /usr/local/bin/backup.nightly

This will run the backup script 'backup.nightly' at 1am every night using the
CShell program.

Hope this helps!

----CUT-HERE----CUT-HERE----CUT-HERE----CUT-HERE----CUT-HERE----CUT-HERE----
#!/bin/csh -f
#
# Nightly backup script for SGI workstations...
#
# Set the 'BUP_DIRS' variable to the directories you wish backed up...
# Set the 'INFORM' variable to the users to inform on error...
#
# Run nightly @ 1:00 am...
#

set BUP_DIRS = "/usr/local /netusr /usr/data"
set INFORM   = "msweet"

#
# Back everything up to tape; we use the 'no-rewind' device...
#
# If an error occurs, inform necessary user(s)...
#

bru -cBZf /dev/nrtape -n /usr/local/bin/last.backup $BUP_DIRS

#
# If an error has occurred, inform people...
#

set bad_status = $status

if ($bad_status == 2) then
 Mail -s "Nightly Backup Failed..." $INFORM <<EOF
The nightly backup failed....
EOF
else
 touch /usr/local/bin/last.backup
endif

#
# End of "backup.nightly".
#
-------------------------------------------------------------------------------
"My Machine Doesn't Work!" -- "Did you turn the monitor on?"

    _/_/_/_/ _/_/_/_/_/ _/_/_/_/    Mike Sweet
   _/           _/     _/    _/     Chesapeake Test Range, RD93
  _/           _/     _/_/_/_/      Naval Air Warfare Center
 _/           _/     _/  _/         Patuxent River, MD 20670
_/_/_/_/     _/     _/    _/        msweet@mailroom.ctr.nawcad.navy.mil

>From fish@daacdev1.stx.com  Tue Jan 11 16:04:31 1994
Message-Id: <9401112204.AA22029@dexter.psych.umn.edu>
Received: from daacdev1.stx.com by dexter.psych.umn.edu; Tue, 11 Jan 94 16:04:31 -0600
Received: by daacdev1.stx.com
	(1.36.108.7/16.2) id AA05884; Tue, 11 Jan 1994 17:10:38 -0500
Date: Tue, 11 Jan 1994 17:10:38 -0500
To: rob@dexter
Subject: Re: Automated backups with crontab?
Newsgroups: comp.sys.sgi.admin
References: <CJHDJy.A2y@news.cis.umn.edu>
From: fish@daacdev1.stx.com (John Vanderpool)
Status: RO

In comp.sys.sgi.admin you write:

>I would like to just have a blank tape in my SGI and
>every day at 2:00 am, do a     tar -c /usr/driving
>then have it do a tar -C /usr/driving > result-file.doc

just do a "tar cvf >result-file.doc" (unless you're really paranoid)

>Could someone please post the format I should use, and am
>I correct in thinking I need to use crontab for this?

yes, crontab is the way to go

i also do a "mt -t /dev/whatever unload" just in case some fool comes in
and writes over the backup tape before i can get to the drive.

		fish


here's a file i use to simplify cron manipulation:

#!/bin/sh
#
#	cronedit, cronview - crontab entry edit, view
#
# note: just make cronview a symbolic (or hard) link to cronedit
#
# 26-oct-1993 jrv re-organized, began to add remote capability (but NOT done!)
# 20-may-1993 jrv add cronview, remove restriction of cwd for edit by using /tmp
# 27-apr-1993 jrv initial release (John.Vanderpool@gsfc.nasa.gov)

${SHDEBUG:-}            # export SHDEBUG="set -x" externally, else this is a nop

self=`basename $0`

if [ `uname` = HP-UX ]; then
  RSH=/usr/bin/remsh    # make sure we get remote shell not restricted shell
else
  RSH=rsh		# assume PATH is in "correct" order
fi


# adding remote capability is NOT done, and might not be worth the effort
if [ "$1" != "" ]; then
  remote="$RSH $1"
else
  remote=""
fi


crontab -l >/dev/null	# check if user has a crontab
status=$?
if [ $status != 0 -a $self != cronedit ]; then exit $status; fi


if [ "$self" = "cronview" ]; then
  crontab -l | ${PAGER:-more}
  exit
fi


tmpcronfile=${TMPDIR:-/tmp}/cronfile.`whoami`
crontab -l > /dev/null && crontab -l > $tmpcronfile
${EDITOR:-vi} $tmpcronfile

echo "submit cronfile? (y/n) [n] : \c"
read answer

if [ "$answer" = "y" -o "$answer" = "Y" ]; then
  crontab $tmpcronfile
  status=$?

else
  status=2
fi


if [ $status = 0 ]; then		# crontab succeeded
  echo "$self: crontab updated."

elif [ $status = 1 ]; then		# crontab failed
  echo "$self: crontab not updated"
  mv $tmpcronfile ${tmpcronfile}.$$
  echo "$self: temporary crontab saved as ${tmpcronfile}.$$"

else					# answer not y|Y
  echo "$self: crontab not updated."
fi

if [ -f $tmpcronfile ]; then /bin/rm -f $tmpcronfile; fi
-- 
John R. Vanderpool     INTERNET: fish@eosdata.gsfc.nasa.gov

Well she's walking, through the clouds, with a circus smile thats running 'round
Butterflies and zebras, and fairytales, that's all she ever thinks about... jh

>From dan@tesla.psych.nyu.edu  Tue Jan 11 16:02:04 1994
Received: from TESLA.PSYCH.NYU.EDU by dexter.psych.umn.edu; Tue, 11 Jan 94 16:02:04 -0600
Received: by tesla.psych.nyu.edu (920330.SGI/920502.SGI)
	for rob@dexter.psych.umn.edu id AA14823; Tue, 11 Jan 94 17:05:01 -0500
From: dan@tesla.psych.nyu.edu (Dan Karron)
Message-Id: <9401112205.AA14823@tesla.psych.nyu.edu>
Subject: Re: Automated backups with crontab?
To: rob@dexter (Robert Stephens)
Date: Tue, 11 Jan 1994 17:05:01 -0500 (EST)
In-Reply-To: <CJHDJy.A2y@news.cis.umn.edu> from "Robert Stephens" at Jan 11, 94 07:41:48 pm
X-Mailer: ELM [version 2.4 PL23]
Content-Type: text
Content-Length: 1347      
Status: RO


Look on my anon ftp for some old disk admin scripts.

I used them for years, and reciently rewrote it in perl.

If you are really interested, I can share that stuff with you.

anon ftp to karron.med.nyu.edu for more stuff.

Also, check out gtar with gzip compression, i can make
snapshot dumps (incrimental plus the usr image) on a 2 gig tape of
about 3 gig of uncompressed stuff. Bru with the compression option
does not do it well enough.


>From Robert Stephens
> 
> I read the FAQs and man pages on crontab, but I am still
> unclear as to the best way to backup automatically.
>  
> I would like to just have a blank tape in my SGI and
> every day at 2:00 am, do a     tar -c /usr/driving
> then have it do a tar -C /usr/driving > result-file.doc
> 
> Could someone please post the format I should use, and am
> I correct in thinking I need to use crontab for this?
> 
> 
> Thanks in advance,
> 
> 
> 
> -- 
> 
> Robert C. Stephens		rob@dexter.psych.umn.edu		
> 
> Human Factors Research Lab
> University of Minnesota
> 


-- 
| karron@nyu.edu (e-mail alias )         Dan Karron, Ph.D.,Research Associate|
| Phone: 212 263 5210 Fax: 212 263 7190  New York University Medical Center  |
| 560 First Avenue                       Digital Pager  <1>  212 397 9330    |
| New York, New York 10016               <2> 10896   <3> <your-number-here>  |

>From shenkin@still3.chem.columbia.edu  Tue Jan 11 15:28:32 1994
Received: from mailhub.cc.columbia.edu by dexter.psych.umn.edu; Tue, 11 Jan 94 15:28:32 -0600
Received: from still3.chem.columbia.edu by mailhub.cc.columbia.edu with SMTP id AA12524
  (5.65c+CU/IDA-1.4.4/HLK for rob@dexter.psych.umn.edu); Tue, 11 Jan 1994 16:32:48 -0500
Received: by still3.chem.columbia.edu (930416.SGI/930416.SGI.AUTO)
	for @cunixf.cc.columbia.edu:rob@dexter.psych.umn.edu id AA07178; Tue, 11 Jan 94 16:32:16 -0500
Date: Tue, 11 Jan 94 16:32:16 -0500
From: shenkin@still3.chem.columbia.edu (Peter Shenkin)
Message-Id: <9401112132.AA07178@still3.chem.columbia.edu>
To: rob@dexter
Subject: Re: Automated backups with crontab?
Newsgroups: comp.sys.sgi.admin
In-Reply-To: <CJHDJy.A2y@news.cis.umn.edu>
Organization: Dept. of Chem, Columbia U, New York
Cc: 
Status: RO

I'm including the scripts I use.  "backup" is what I feed to cron;
all it does is call "csh" to execute "backup.csh2".  This script
makes a tar tape, summarizes the contents, verifies it with "tar -C",
listing suspicious entries, and saves the diagnostics plus 
table-of-contents in a file called "latest".  Periodically, I move this 
file to some other name and save the tape.  The appended uuencoded
file will uudecode to "backup.tar.Z", which should be "uncompress"-ed
and "tar -x"-ed.

	Hope this helps.
	-P.

begin 660 backup.tar.Z
M'YV08L*,65,'#H"#"!,J7,BPH<.'$"-*1`BCXHT:-4``J`B#QHT9&CG&H)%Q
M(\>3,&S<``$#8TL:,V2,S`@CA@P:'0&PG,BSI\^?0`'4F4,GC!R3<]"4<;,F
MC9N@"HFF8<.&3!D[4+-JW<JUJ]>O$,>0`?%BJ)P7<,J\@<.FS(ND2YNZ>1%P
M8,$Y"N@Z?3$F*8@69D#4)0C'15\T,A2`7<RXL>/'D"-+GDRY,D,(`%#0^O/O
M&!S.Q\Z!-@CD`6:>@PL:3BK#LNN%'"^6Y.@1I,F:)$.BK&D#QLJ6-6+,@#'C
M!@WA+(7?C*$3QNOG$H<6/5H1+E.G7*52M8H5NO?OX(.."$%6S-[#?\TH$$O6
M+%JU;-U:ETM7(.$Y(':`X*)@.H@Q=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IC6M>\US8QE:VLPWQ9&Q[G+)FJ">YS1!P@LO;M@PW
MK%C]S6Y$&5SA1$<LQ9V.ALAR6^3"Z"?*Q:I]M,(<%3<GH"S^RBC!VA3B3E<Z
M/9*.;=.+I"0G2<E*6O*2F,RD)C?)R4YZ\I.@#*4H1TG*4IKRE*A,I2I7R<I6
MNO*5L(RE+&=)RUK:\I:XS*4N=\G+7OKRE\`,IC"'2<QB&O.8R$RF,I?)S&8Z
0\YG0C*8TITG-:EKSFMB$):4N
`
end
-- 
********** "Democracy:  The theory that the common people know what *********
******** they want, and deserve to get it good and hard."  (Mencken) ********
Peter S. Shenkin, Box 768 Havemeyer Hall, Dept. of Chemistry, Columbia Univ.,
New York, NY  10027;     shenkin@still3.chem.columbia.edu;     (212) 854-5143

>From @VM.BS.DLR.DE:beyer@bflsgu.fl.bs.dlr.de  Wed Jan 12 06:55:37 1994
Received: from vm.bs.dlr.de by dexter.psych.umn.edu; Wed, 12 Jan 94 06:55:37 -0600
Received: from bflsgu.fl.bs.dlr.de by VM.BS.DLR.DE (IBM VM SMTP R1.2.2MX) with TCP; Wed, 12 Jan 94 14:00:04 MEZ
Received: by bflsgu.fl.bs.dlr.de (5.52/890607.SGI)
	(for @vm.bs.dlr.de:rob@dexter.psych.umn.edu) id AA02528; Wed, 12 Jan 94 13:59:59 +0100
Date: Wed, 12 Jan 94 13:59:59 +0100
From: beyer@bflsgu.fl.bs.dlr.de (Ralf Beyer DLR)
Message-Id: <9401121259.AA02528@bflsgu.fl.bs.dlr.de>
To: rob@dexter
Subject: archive
Cc: info-iris-admin@brl.mil
Status: RO

	I would like to just have a blank tape in my SGI and
	every day at 2:00 am, do a     tar -c /usr/driving
	then have it do a tar -C /usr/driving > result-file.doc

1. cd /usr/tmp.

2. Install the following script in /usr/tmp/backup.

	#!/bin/csh

	set MYDIR=/tmp

	mt rewind

	if ($1 == new) then
		tar cv $MYDIR
		else
		mt feom
		tar cv $MYDIR
	endif

3. Give the script execution priviledges.

4. Edit the script and set MYDIR to the directories/
   files to be backed-up.

5. Insert a new or used and unformatted DAT.

6. Create the first archive of the directories/files
   specified by MYDIR manually by executing

	/usr/tmp/backup new

7. Install the following script in /usr/tmp/tem

	#
	# $Revision: 1.3 $
	#
	# The root crontab can be used to perform
	# accounting data collection and and clean up.
	#
	# Format of lines:
	#min	hour	daymo	month	daywk	cmd
	#
	0	2	*	*	*	/usr/tmp/backup

8. Submit the script to your crontab file

	crontab tem

9. The directories/files specified by MYDIR will be backed-up
   daily at 2 a.m. in consecutive, separate archives on the
   tape. 

Regards

Ralf Beyer
German Aerospace Research Establishment (DLR), Institute for Flight
Guidance, P.O.Box 3267, D-38022 Braunschweig, Fed. Rep. of Germany
beyer@bflsgu.fl.bs.dlr.de (working hours) fl17@dlrvmbs.bitnet (24 h) 

Article: 5765 of comp.sys.sgi.admin
Path: news3.cis.umn.edu!umn.edu!news-feed-2.peachnet.edu!news-feed-1.peachnet.edu!darwin.sura.net!newsserver.jvnc.net!dizzy.cplex.com!irv
From: irv@dizzy.cplex.com (Irv Lustig)
Newsgroups: comp.sys.sgi.admin
Subject: Re: Automated backups with crontab?
Date: 12 Jan 1994 14:44:45 GMT
Organization: CPLEX Optimization, Inc.
Lines: 29
Distribution: world
Message-ID: <2h12ct$muf@c3po.jvnc.net>
References: <CJHDJy.A2y@news.cis.umn.edu>
NNTP-Posting-Host: lustig.jvnc.net

In article <CJHDJy.A2y@news.cis.umn.edu>, rob@dexter.psych.umn.edu (Robert Stephens) writes:
|> I would like to just have a blank tape in my SGI and
|> every day at 2:00 am, do a     tar -c /usr/driving
|> then have it do a tar -C /usr/driving > result-file.doc
|> 
|> Could someone please post the format I should use, and am
|> I correct in thinking I need to use crontab for this?
|> 

Create a file called /usr/local/adm/overnight with the following in it
#!/bin/csh -f
tar -c /usr/driving
tar -C /usr/driving > result-file.doc

Then do a
   chmod 700 /usr/local/adm/overnight

Then put the following line in your crontab

0 2 * * * /usr/local/adm/overnight

That should do it.  Of course, you can put any csh commands you want in the
overnight file.

	-Irv Lustig
	Director of Numerical Optimization
	CPLEX Optimization, Inc.
	irv@dizzy.cplex.com





Robert C. Stephens		rob@dexter.psych.umn.edu		

Human Factors Research Lab
University of Minnesota


From neutron.chem.yale.edu!dcs Tue Jan 18 16:00:10 1994
Received: from neutron.chem.yale.edu ([130.132.25.75]) by viz.tamu.edu with SMTP id <12922>; Tue, 18 Jan 1994 16:00:04 -0600
Received: by neutron.chem.yale.edu (931110.SGI.ANONFTP/931108.SGI.AUTO.ANONFTP)
	for sgi-faq@viz.tamu.edu id AA17264; Tue, 18 Jan 94 16:58:10 -0500
From:	dcs@neutron.chem.yale.edu (Dave Schweisguth)
Message-Id: <9401182158.AA17264@neutron.chem.yale.edu>
Subject: Re: your mail
To:	rob@dexter.psych.umn.edu (Robert Stephens)
Date:	Tue, 18 Jan 1994 15:58:10 -0600
Cc:	sgi-faq@viz.tamu.edu (SGI Frequently Asked Questions list)
Reply-To: sgi-faq@viz.tamu.edu (SGI Frequently Asked Questions list)
In-Reply-To: <9401131539.AA27404@dexter.psych.umn.edu> from "Robert Stephens" at Jan 13, 94 09:39:53 am
X-Mailer: ELM [version 2.4 PL23]
Content-Type: text
Content-Length: 664       

Robert,

> I enjoy your SGI faq very much, and I thought the following might be
> useful to include in the SGI-admin FAQ.  These are responses I received
> after posting for info on how to use crontab to automate a tape
> backup.  I guess you can decide which one works best.  Keep up the good
> work.

Thanks much for sending your results. Rather than cut down on anyone's
options, I've put the whole thing in the archive on viz.tamu.edu. Let
us know if you get any more along the same lines.

Cheers,

-- 
| Dave Schweisguth   Yale MB&B & Chemistry   Net: dcs@neutron.chem.yale.edu |
| For complying with the NJ Right To Know Act:  Contents partially unknown. |


