Señor
Crear un script con el siguiente contenido:
#!/bin/bash
# Zimbra Backup Script# Requires ncftp to run
# This script is intended to run from the crontab as root
# Date outputs and su vs sudo corrections by other contributors, thanks, sorry Idon't have names
# to attribute!
# Free to use and free of any warranty! Daniel W. Martin, 5 Dec 2008
start_date="$(date +%F)"# Outputs the time the backup started, for log/tracking purposes
echo Time backup started = $start_date at $(date +%T)before="$(date +%s)"
rm -rvf /backup/zimbra/*
# Live sync before stopping Zimbra to minimize sync time with the services down
# Commentout the following line if you want to try single cold-sync only
rsync -avHK --delete /opt/zimbra/ /backup/zimbra
# which is the same as: /opt/zimbra/backup
# Including --delete option gets rid of files in the dest folder that don't exist at the src
# this prevents logfile/extraneous bloat from building upovertime.
# Now we need to shut down Zimbra to rsync any files that were/are locked
# whilst backing up when the server was up and running.before2="$(date +%s)"
# Stop Zimbra Services
su - zimbra -c "/opt/zimbra/bin/zmcontrol stop"
sleep 15# Kill any orphaned Zimbra processes
kill -9 `ps -u zimbra -o "pid="`
# Only enable the following command if you need all...
Regístrate para leer el documento completo.