Now that we have a nightly backup of the joomla database we should probably make regular back ups of the folder structure to a separate machine. Our network is a predominately Windows based one. So we need to first of all gzip up the folder along with the database and then write it to the P: drive using Samba:
date=`date +%Y-%m-%d_%Hh%M`
mysqldumpdir='/home/administrator/Scripts/joomla-backup/'
mysqldump -uroot --password='******' --all-databases | gzip > $mysqldumpdir$date.gz
tar -c /var/www/joomla/ -i $mysqldumpdir$date.gz | gzip -c > Documents/backup.tar.gz
This first of all puts the joomla folder and the mysqldump file created last post into a tape archive. We string that together and gzip the results, at the moment this points to the Documents folder of the administrator, we will have to now hook it up with Samba. I started by installing the
Samba client on my Ubuntu build. Or if you want an easier route, try Places -> Connect to Server, you can see it from there.
But you want to
mount it right, folow the guide. warning make sure that the code will run from anywhere and use absolute addresses, then copy your local backup to the backup server, code looks like this:
date=`date +%Y-%m-%d_%Hh%M`
mysqldumpdir='/home/administrator/Scripts/joomla-backup/'
backupfolder='/home/administrator/Documents/'
mysqldump -uroot --password='******' --all-databases | gzip > $mysqldumpdir$date.gz
tar -c /var/www/joomla/ -i $mysqldumpdir$date.gz | gzip -c > $backupfolder$date.tar.gz
cp $backupfolder$date.tar.gz /mnt/devserver/$date.tar.gz