HELP use tbmonitor non-interactive way!
Posted in 1992
Topics: Connectivity: ODBC / JDBC / .NET, Transactions, Locking & Isolation
Yes, you can use tbmonitor in a non-interactive way. We create an empty file on disk to hold the archive or backup of transaction logs. I then have a shell script that runs out of cron to shut Turbo down, do the archive and bring Turbo back online. -------------- cron entry --------------------------------------------- 50 22 * * 1-4 ulimit 40240000; /bin/su informix -c "/usr/informix/local/bkup" --------------------shell script--------------------------------------- #makes sure you have an empty file (pretend your mounting a tape) #also sets permissions cp /dev/null /bkup1/dblogs/dblog chmod 666 /bkup1/dblogs/dblog #sets engine to Turbo (may already be set, just a precaution) SQLEXEC=/usr/informix/lib/sqlturbo export SQLEXEC #removes old copy of archive (we do not have room for two copies on #the same disk) rm /bkup1/dblogs/archive # put Turbo in Quiescent mode /usr/informix/bin/tbmode -u #archives database - system messages are stored in file bkup.out /usr/informix/bin/tbtape -s > /usr/informix/local/bkup.out <<+ + #copies archive to new file (pretend your unmounting a tape and labeling #it) also sets permissions mv /bkup1/dblogs/dblog /bkup1/dblogs/archive cp /dev/null /bkup1/dblogs/dblog chmod 666 /bkup1/dblogs/dblog # puts Turbo back online /usr/informix/bin/tbmode -m #mails file bkup.out to me so I can check for error messages, etc. /usr/tools/send -t "jgeary" -c "" -s "TURBO" -f /usr/informix/local/bkup.out -n <<+ s + --------------------------------------------------------------------------- This has been working fine for us. The only problem is, you don't know if the archive worked or not until you get to work in the morning. Jane Geary Red River Army Depot DSN 829-2358 COMM 903-334-2358