Dear All
I am using zimbra OSE 7.1.4 and I have 2 scripts which I just modified a little for my environment.
the first creates a .tgz file
and the second ftps this file to another machine.
when I run them everything works great and no issues
but when i run them via cron i face problems
first zimbra does not start and also backup is not done
i do backups in the night so in the morning i have to restart zimbra or maybe restart the machine
i tried googlin arround but not achieve much
here below my scripts
the files are executables
---------
#A Simple Shell Script Method
#!/bin/bash
# Zimbra Backup Script
# This script is intended to run from the crontab as root
# Outputs the time the backup started, for log/tracking purposes
echo Time backup started = $(date +%T)
before="$(date +%s)"
rsync -avHK --delete /opt/zimbra/ /root/backup
service zimbra stop
sleep 25
# Kill any orphaned Zimbra processes
ORPHANED=`ps -u zimbra -o "pid="` && kill -9 $ORPHANED
rsync -avHK --delete /opt/zimbra/ /root/backup
service zimbra start
# Calculates and outputs amount of time the server was down for
after="$(date +%s)"
elapsed="$(expr $after - $before2)"
hours=$(($elapsed / 3600))
elapsed=$(($elapsed - $hours * 3600))
minutes=$(($elapsed / 60))
seconds=$(($elapsed - $minutes * 60))
echo Server was down for: "$hours hours $minutes minutes $seconds seconds"
--------------------
the second script
--------------
#!/bin/bash
#
USER="xxxxx"
PASSWD="xxxxxxx"
SERVER="192.168.100.33"
ftp -n -i $SERVER << EOF
user $USER $PASSWD
prompt
bin
put /tmp/mail.backup.tgz
bye
------------------------------------
I really would appreciate if someone could advise me and help me out.
do i have to rename the file with .sh extension???
regards
simon


LinkBack URL
About LinkBacks

