Server Backup

Discuss the Scalix Server software

Moderators: ScalixSupport, admin

wmcdonald
Posts: 29
Joined: Wed Sep 20, 2006 8:11 pm
Location: Louisiana, U.S.A.

Server Backup

Postby wmcdonald » Mon Mar 05, 2007 3:01 pm

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]#
Regards,

W. J. McDonald
Southern Recycling, LLC
Covington, Louisiana

dkelly
Scalix
Scalix
Posts: 593
Joined: Thu Mar 18, 2004 2:03 pm

Postby dkelly » Mon Mar 05, 2007 3:46 pm

Can you explain the problems you are seeing ?

Cheers

Dave

wmcdonald
Posts: 29
Joined: Wed Sep 20, 2006 8:11 pm
Location: Louisiana, U.S.A.

reply

Postby wmcdonald » Mon Mar 05, 2007 4:02 pm

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.
Regards,



W. J. McDonald

Southern Recycling, LLC

Covington, Louisiana

kanderson

Postby kanderson » Mon Mar 05, 2007 7:15 pm

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.

ScalixSupport
Scalix
Scalix
Posts: 5503
Joined: Thu Mar 25, 2004 8:15 pm

Postby ScalixSupport » Tue Mar 06, 2007 2:30 am

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

wmcdonald
Posts: 29
Joined: Wed Sep 20, 2006 8:11 pm
Location: Louisiana, U.S.A.

Postby wmcdonald » Tue Mar 06, 2007 1:24 pm

Thanks, I'll run this through tonight and see what happens.
Regards,



W. J. McDonald

Southern Recycling, LLC

Covington, Louisiana


Return to “Scalix Server”



Who is online

Users browsing this forum: No registered users and 13 guests

cron