What I do is use the following.
Thanks to Filippo Carletti's post on devinfo for the original
desktop backup script.
I have made a crontab file for root, shown as mycronfile below.
by usng 'crontab mycronfile' whilst logged in as root tasks listed
in this file are executed by cron.
The part shown below will start the backup to desktop at 5.01am daily
<--- This is part of mycronfile --->
# Allow one minute then backup the server
1 5 * * * /usr/bin/desktop_backup.sh
<--- end --->
Note that it calls a shell script (also below) which I put into /usr/bin
and you need to supply the hostname, the share, username and password.
I think that this method could be improved as putting the
username and password in the shell script is not nice.
Also as it stand they are also logged.
Currently this is OK for my set-up but it I want to improve it later.
You may want to check that this backs up exactly what you want as
I have customised it to meet *my* needs.
Firstly the date appears in the backup filename.
Secondly check what you really want backed up, and add any additional directories
eg under /opt, just before the etc/smbpasswd
I believe, but cannot confirm, that this matches the 5.5 release.
I advise that you test this out before relying on it. All I can say is that
I have used it (backup & restored) on all released SME 5.x versions (not 5.6alpha)
<--- desktop.sh starts here --->
#!/bin/sh
if [ $# -lt 4 ]; then
echo "Usage: $(basename $0) "
exit 1;
fi
SMBHOST=$1
SMBSHARE=$2
SMBUSER=$3
SMBPASS=$4
#TIME is the date in mmmddyyy format 'Apr132003' this is used in the filename
TIME=/bin/date | /bin/awk '{print $2$3$6}'
#FILENAME is the full filename of the backup, traditionally smeserver.tgz
FILENAME="smeserver${TIME}.tgz"
/sbin/e-smith/signal-event mysql-delete-dumps
/sbin/e-smith/signal-event mysql-dump-tables
/bin/tar --directory / --create home/e-smith etc/e-smith/templates-custom etc/e-smith/templates-user-custom etc/passwd etc/shadow etc/group etc/gshadow etc/ssh root/.ssh root etc/smbpasswd --file=- | gzip | ( echo put - "${FILENAME}"; cat ) | smbclient "//${SMBHOST}/${SMBSHARE}" "${SMBPASS}" -U "${SMBUSER}" &>/dev/null
/sbin/e-smith/signal-event mysql-delete-dumps
<--- desktop.sh ends here --->