Re: mksysb script

From: Pipiron (pipiron0309_at_yahoo.com)
Date: 06/13/03


Date: Fri, 13 Jun 2003 16:06:09 +0200

Hi Marc,

I have tried the script and it works fine regarding mksysb. Script does
start mksysb, it does create log file with date but file is empty.
Now I put the line for errors only, but I prefer to have some text in it. It
means that depending of return code of command it should be successfully
finished backup or unsuccessfully.
I have enough space in /tmp and the script is executable

Best regards

PJ

"Bigi Brada" <bigibrada@hotmail.com> wrote in message
news:1055510432.297867@newsreader1.wirehub.nl...
> Pipiron <pipiron0309@yahoo.com> wrote in message
> news:1055507248.4432@internet.fina.hr...
> > Dear colleagues,
> >
> > I should schedule mksysb on AIX 4.3.3 machine every day at the same
time.
> > Also should have record in a log file about backup and status of backup.
> So
> > I made following script:
> >
> > bkup_ skripta
> >
> > #!/bin/ksh
> > mv /tmp/bkup/mksysb.log /tmp/bkup/YYYYMMDD.mksysb.log
> > /usr/bin/mksysb -i /dev/rmt0
> > mt -f /dev/rmt0 rewoffl
> >
> > In Cron
> >
> > 1) crontab -e
> > 2) 22 05 * * 1,2,3,4,5 /tmp/bkup/bkup_ skripta>> /tmp/bkup/mksysb.log >
> 2&1
> >
> >
> > This last line in Cron should report error if occurs. But, all the time
I
> > have logs with nothing in it (size 0), even if error occurs.
> > Now I am not a guru for scripting, so I would really appreciate if
someone
> > can help me about following:
> > how can I have logs with status of backup in it. That means I should
have
> > something like
> >
> > 20030625.mksysb.log and in it either "Backup finished successfully"
either
> > "Backup finished with errors"
> >
> > Thanks in advance
> >
> > PJ
>
> Is there any message in your mail?
> Is there enough space in /tmp to create temp-files en log 4 the backup?
> Try running the backup script on the command line with the log redirected
as
> you do
> and see if it runs fine then you know if the problem is the cron or the
> script!
> Are you sure the script is executable? (i.e. # chmod 700 /tmp/bkup/bkup_
> skripta)
> You can start mksysb with -X to auto-expand /tmp.
>
> This is my cron entry:
> 0 19 * * 1-5 /usr/local/backup/backup.sh
>
> This is my backup script in short:
>
> LOG="/usr/local/log/backup_RS-EV1.log"
> DEV="/dev/rmt1"
>
> # Rotate logfiles:
> mv $LOG.13 $LOG.14 >/dev/null 2>&1
> mv $LOG.12 $LOG.13 >/dev/null 2>&1
> mv $LOG.11 $LOG.12 >/dev/null 2>&1
> mv $LOG.10 $LOG.11 >/dev/null 2>&1
> mv $LOG.9 $LOG.10 >/dev/null 2>&1
> mv $LOG.8 $LOG.9 >/dev/null 2>&1
> mv $LOG.7 $LOG.8 >/dev/null 2>&1
> mv $LOG.6 $LOG.7 >/dev/null 2>&1
> mv $LOG.5 $LOG.6 >/dev/null 2>&1
> mv $LOG.4 $LOG.5 >/dev/null 2>&1
> mv $LOG.3 $LOG.4 >/dev/null 2>&1
> mv $LOG.2 $LOG.3 >/dev/null 2>&1
> mv $LOG.1 $LOG.2 >/dev/null 2>&1
> mv $LOG $LOG.1 >/dev/null 2>&1
>
> /usr/bin/mksysb -X -m -p $DEV >>$LOG 2>&1
>
> Good luck
> Marc
>
>



Relevant Pages

  • Script to Email Confirmation if Latest File Contains Specific String
    ... script which does the following: ... If a backup was successful, ... If that file contains the string '100.00', ... log file, as well as a confirmation such as 'Backup likely successful'. ...
    (microsoft.public.windows.server.scripting)
  • Re: Log date
    ... It seems you can't use the "`" syntax because a crontab is not a script. ... If you had installed the mail command, you would have received a mail ... with the problem every time cron failed to execute your command. ... but what I would like is to create a log file with a date in the name ...
    (Ubuntu)
  • [OT] mondoarchive via cron - how do you know if it completed correctly?
    ... I've been using mondoarchive for awhile now for interactive backup to CD's. ... We put in a tape drive and I set it up to backup to tape every night by ... writing a very simple script and putting it in /etc/cron.daily (the script ... The problem is that I get a 6k log file each morning ...
    (RedHat)
  • Re: unix shell script ignores exit when in function that is piped to tee
    ... > I thought calling a function within a script did NOT create sub-shells. ... is going to be able to alter the log file to cover up any inappropriate ... entry in the log to the previous entry. ... The easiest way to use crypt to ...
    (comp.unix.shell)
  • Re: Scheduling a script
    ... I do have a log file backup scheduled along with my regular backup. ... It can schedule jobs and run code. ... > Can I add though that this script is probably not a good idea. ...
    (comp.databases.ms-sqlserver)