Page 1 of 1

Server Backup

Posted: Mon Mar 05, 2007 3:01 pm
by wmcdonald
I seem to have a problem running omshut and omrc from within a script. All info below ... anyone have any idea what's wrong. I'm running this through cron.

-rwxrwxrwx 1 root root 770 Nov 13 11:26 scalixbk.sh

[root@mail shell]# cat scalixbk.sh
#! /bin/sh
#
# Script : /opt/shell/scalixbk.sh
#
# This script is used to backup the Scalix files on remote scalix server
# then ftp the tar file to the Windows server to be dumped to the
# daily backup tape later that night
#
date
cd /backup
#
# Shut down Scalix services and show in log status
#
omshut
omstat -a
#
# copy /var/opt/scalix to /backup/scalixrr.tar using tar
#
tar -cvf scalixrr.tar /var/opt/scalix/*
#
# copy /backup/scalixrr.tar to \\s-server\c:\ftp using ftp
#
ftp -n << "ENDFTP"
open 128.85.55.3
user uuuuuuuuu ppppppp
bin
put scalixrr.tar
ls
bye
ENDFTP
#
# Bring Scalix back up
#
omrc
omstat -s
#
cd /backup
ls -al
date
# end of script
[root@mail shell]#

Posted: Mon Mar 05, 2007 3:46 pm
by dkelly
Can you explain the problems you are seeing ?

Cheers

Dave

reply

Posted: Mon Mar 05, 2007 4:02 pm
by wmcdonald
When I look at omstat -a or -s, I see the last start date as the last time I started the system manually. I believe the omshut command and the omrc command is not running in my script. It doesn't seem that any of the OM commands are running because the omstat command within the script is not showing up either.

Posted: Mon Mar 05, 2007 7:15 pm
by kanderson
You will need to specify a full path the the commands.

so just proceed omon &/or omoff with /opt/scalix/bin/

And all should be fine. I suspect tar & ftp might also need a full path too.

Kev.

Posted: Tue Mar 06, 2007 2:30 am
by ScalixSupport
Hi!

When you run a script through cron, it is always better to add or declare the basic
environments that could be required in the script. So in your case begin your cron script
with the variables below with appropriate paths:

Code: Select all

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:.:/usr/bin:/opt/scalix/bin
HOME=/home/nnnnnnnnn
cron statement for scalixbk.sh


Note: In the variable PATH, you need to add folder path for Scalix commands, i.e.
/opt/scalix/bin

I am sure this should help.

Thanks,
Subir

Posted: Tue Mar 06, 2007 1:24 pm
by wmcdonald
Thanks, I'll run this through tonight and see what happens.