AIPS HELP file for BAKUP in 31DEC26
As of Fri Oct 9 1:38:17 2026
BAKUP: Back up a directory to a dated backup cite
INPUTS
SYSCOM Directory to be backed up
' ' -> '$HOME'
SYSOUT Directory for output
PRTLEV -1.0 13.0 Verbosity control: 0 quiet
1 list top files, 2 list all
+ 10 also do directories
named .*
HELP SECTION
BAKUP
Task: Because of the failure of observatory file backup systms, this
task allows the user to schedule needed backups. Unlike the
observatory backups, you may omit files with directory names
that start with a period. There are many many files in areas
like .thunderbird , .mozilla, .snapshot (!!), .netscape,
.openoffice, and many more.
See EXPLAIN BAKUP for the details and suggestions for creating
a cron job.
Adverbs:
SYSCOM.....The directory to be recursivly backed up.
SYSOUT.....The directory to which to copy the files. A directory
named after the local data and time will be created and all
files in and below SYSCOM will be copied to it.
PRTLEV.....Degree of verbosity.
= 0 quiet
= 1 list the DATAIN top level files on message server
= 2 also do the copy in verbose mode, every file copied
will be listed on your terminal.
= 10 quiet but copy also directories whose names start
with a period
= 11 as 10 plus 1
= 12 as 10 plus 2
EXPLAIN SECTION
BAKUP: Back up a directory & everything below it to a dated backup site
This program may be run as an AIPS task. It takes SYSCOM as the disk
directory to be backed up with '$HOME' as the default. It then takes
SYSOUT as the directory to which the input drectory is copied. PRTLEV
controls the amount of output written by the task and whether directory
names starting with a period are included. Note that SYSOUT must point
at a directory that already exists.
Both SYSCOM and SYSOUT are limited to 72 characters which may require
the use of environment variables. You may express both as for example
'MYWORK:' but not as 'MYWORK:subdir'. More flexibility is available
when expressed in Unix form such as '$MYWORK', '$MYWORK/subdir/ssdir',
or '/home/primate/janedoe/data'. Be sure to leave of the close quote
if SYSCOM or SYSOUT need to retain lower case letters.
The program can also be run outside of AIPS with the command
RUN BAKUP
In that mode it will prompt you for the three adverbs in order. When
running in this mode the quote marks are not required.
BACKUP starts by creating a new directory in SYSOUT of the form
ddMMMyyhhmm
where dd is the day, MMM the month (3 characters), yy is the year,
hh the hour, and mm the minute. Then it lists SYSCOM with
ls -1 (PRTLEV < 10)
ls -1A (PRTLEV >= 10)
directing the output to a text file /tmp/BAKUPddMMMyyhh.txt. It then
reads this file and does, for filename not starting with a period
cp -r DATAIN/filename > DATAOUT/ddMMMyyhh/ (PRTLEV = 0,1,10,11)
cp -rv DATAIN/filename > DATAOUT/ddMMMyyhh/ (PRTLEV = 2,12)
For filenames starting with a period, it does
cp DATAIN/filename > DATAOUT/ddMMMyyhh/ (PRTLEV = 0,1)
cp -v DATAIN/filename > DATAOUT/ddMMMyyhh/ (PRTLEV = 2)
which will copy regular files but not directories. The verbose copy
writes its messages to the user terminal showing each file copied
including in directories below filename. BAKUP also writes the name
of each file (in DATAIN only) to the message terminal when PRTLEV is
not 0 or 10. File names containing blanks and parentheses should work.
Other special chacters may not. The directory named .snapshot is never
copied.
You may want to use BAKUP with a cron job to do regular backups without
having to remember to do them. To do this you need to create two files,
the procedure to do this and the data file for it to read. The first
might look like
#!/bin/sh
#
. /users/janedoe/MYAIPS/LOGIN.SH >/dev/null 2>&1
$CDTST >/dev/null 2>&1
echo "*** writing file $HOME/backup.report"
echo "*** input from $HOME/backup.in"
cat $HOME/bakup.in
echo "*** patience is required"
#
RUN BAKUP > $HOME/bakup.report 2>$HOME/bakup.rep2 < $HOME/bakup.in
This puts error output in a separate file. The timing of messages
get confusing when the error output is the same as the ordinary
message output. To do this use instead
RUN BAKUP > $HOME/bakup.report 2>&1 < $HOME/bakup.in
The second might then look like
$HOME
/stash/users/janedoe/backup/
2
This will back up all files including those that start with a period
(in $HOME) including all sub-directories. Directries in $HOME startng
with a period will not be copied. Do change the stash line to your
backup area (don't use mine!). Be sure that any environment variables
are known to cron in your login or define them in the first file with
the actual path such as shown above. Note that the directory in the
second line of bakup.in must exist prior to running BAKUP.
PRTLEV = 0 in the main message report file (called bakup.report above)
about opening the text file and the errors from failing to copy
top-level directories whose name begins with a period. PRTLEV = 1
adds to the main report file the names of all top-level files with a
sequence number. PRTLEV = 2 omits this list and adds full verbose
messages showing the input and output names of all files copied.
The error report (called bakup.rep2 above) is the same for all PRTLEV.
It lists any error such as directories whose names begin with a
period failing to copy. "Permissiom denied" messages appear about any
file for which you lack read priviledge.