ontape from crontab
Posted in 2000
Topics: Backup & Restore, Storage & Space Management
I am trying to run ontape from a cron job.
The following is a copy of the batch file activated by cron.
tmp=$$
LD_LIBRARY_PATH=/opt/informix/lib/tools
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin/X11:/usr/X11R6/bin:/opt/informix/bin:/root/bin
DBLANG=en_us
USER=root
DBCENTURY=C
INFORMIXDIR=/opt/informix
INFORMIXSERVER=ebilosLANG=en_US
DBSPACETEMP=tempdbs
DBLANG=en_us
echo -e "\\nLevel 0 Backup of Cash system begins "`date`" \\n" >
/tmp/cash-backup.${tmp}
echo -e "\\n\\n" | ontape -s -L 0 2>&1 >> /tmp/cash-backup.${tmp}
echo -e "\\nLevel 0 Backup of Cash system ends "`date` >>
/tmp/cash-backup.${tmp}
The first and third echo statements appear in the /tmp/cash-backup.$tmp
file, but the ontape command shows nothing. I have tried to change options,
etc. with ontape, but it does not want to activate/run.
Does anyone have any ideas?
Thanks for your help.
Joe Terry
Joe,
When you run ontape from the command line, there's a point where it asks you to
insert tape and press return to start the archive. I have ontape running via
cron and how I got around that is to feed it the ascii carriage return character
(^M) through a file. Here's what my crontab entry looks like:
/usr/informix/bin/ontape -s -L 0 < /usr/local/bin/tapevars
The /usr/local/bin/tapevars is just a file with the ^M in it. Oh, in addition,
if you have this cronjob running as informix, you don't have set all those
environment variables again, provided they're there in the first place. Let me
know if you have any questions.
Joe Terry wrote:
> I am trying to run ontape from a cron job.
> The following is a copy of the batch file activated by cron.
>
> tmp=$$
> LD_LIBRARY_PATH=/opt/informix/lib/tools
> PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin/X> 11:/usr/X11R6/bin:/opt/informix/bin:/root/bin
> DBLANG=en_us
> USER=root
> DBCENTURY=C
> INFORMIXDIR=/opt/informix
> INFORMIXSERVER=ebilos> LANG=en_US
> DBSPACETEMP=tempdbs
> DBLANG=en_us
> echo -e "\\nLevel 0 Backup of Cash system begins "`date`" \\n" >
> /tmp/cash-backup.${tmp}
> echo -e "\\n\\n" | ontape -s -L 0 2>&1 >> /tmp/cash-backup.${tmp}
> echo -e "\\nLevel 0 Backup of Cash system ends "`date` >>
> /tmp/cash-backup.${tmp}
>
> The first and third echo statements appear in the /tmp/cash-backup.$tmp
> file, but the ontape command shows nothing. I have tried to change options,
> etc. with ontape, but it does not want to activate/run.
>
> Does anyone have any ideas?
>
> Thanks for your help.
>
> Joe Terry
--
Phillip Tien
Database Administrator
Whole Foods Market, Inc.
If I ever get rich, I hope I'm not real mean to poor people, like I am now.
On Fri, 10 Nov 2000 09:23:29 -0700, "Joe Terry" <jterry@xmission.com>
wrote:
>I am trying to run ontape from a cron job.
>The following is a copy of the batch file activated by cron.
>
>tmp=$$
>LD_LIBRARY_PATH=/opt/informix/lib/tools
>PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin/X>11:/usr/X11R6/bin:/opt/informix/bin:/root/bin
>DBLANG=en_us
>USER=root
>DBCENTURY=C
>INFORMIXDIR=/opt/informix
>INFORMIXSERVER=ebilos>LANG=en_US
>DBSPACETEMP=tempdbs
>DBLANG=en_us
>echo -e "\\nLevel 0 Backup of Cash system begins "`date`" \\n" >
>/tmp/cash-backup.${tmp}
try
echo -e "\\n\\n" | ontape -s -L 0 >> /tmp/cash-backup.${tmp} 2>&1
>echo -e "\\n\\n" | ontape -s -L 0 2>&1 >> /tmp/cash-backup.${tmp}
>echo -e "\\nLevel 0 Backup of Cash system ends "`date` >>
>/tmp/cash-backup.${tmp}
>
>The first and third echo statements appear in the /tmp/cash-backup.$tmp
>file, but the ontape command shows nothing. I have tried to change options,
>etc. with ontape, but it does not want to activate/run.
>
>Does anyone have any ideas?
Yes
1) detach setup for informix from this script to have it in separate
script = one setup script for all.
2) start and end time is better get from log file - I found script
archlog.sh in dbmon_pm package on IIUG site (www.iiug.org)
>Thanks for your help.
>
>Joe Terry
>
Warning: My english is poor!
--
Jiří Lisický ČD KMŽP Olomouc
e-mail: lisicky@datis.cdrail.cz Vídeňská 15
phone: +420-068-472-2272 Olomouc, Czech Republic
>>> čeština ISO-8859-2 Compatible <<<