Friday 27 February 2009

Setting up rsnapshot backup tool on Linux + NFS

Since the Mac server is now sharing it's RAID device with NFS the Linux server can now backup to this share.

Hint:
I'm always struggling to get NFS going for some reason, using the command showmount -e
you will get a list of the NFS server's shares. That helps a lot!

I set up a seperate partition on the Mac server as an NFS share only to be accessed by one IP address, that is the IP of the Linux server.

The Linux server has an hourly cronjob to keep the NFS mounted, just to be sure. I placed this file in /etc/cron.hourly/MountNFS-Share Contents:
#!/bin/sh
mount 192.168.0.3:/Volumes/Jupiter-Backups /mnt/backup/

Next I added this following to /etc/crontab on the Linux server:
0 4 * * * root /usr/bin/rsnapshot hourly
50 23 * * * root /usr/bin/rsnapshot daily
40 23 1,8,15,22 * * root /usr/bin/rsnapshot weekly
30 23 1 * * root /usr/bin/rsnapshot monthly

This way the Linux server should backup itself incrementally to the Mac server's RAID device. Also, because the backup goes to the RAID device it will automaticaly be an extra off-site backup.


Installed new backup hardware

The 500GB backup disk in the Mac server is showing a SMART failure warning. So needs replacing. We also wanted a more solid offline backup method.

We placed a DeoNet RAID external USB2.0 next to the server. Backups will now be as followed:
  • Mac server Time Machine will backup itself to the RAID device
  • Mailbfr running on the Mac server will backup all the mail files to the RAID device
  • The Mac server will share the RAID using separate partitions, one for the Linux server and one for Time Machine clients on the LAN
  • The Linux server will backups its data to the shared RAID using rsnapshot and NFS
  • Macs on the LAN will backup themselves using Time Machine via the Mac server on the RAID.
There are two 1TB discs in the RAID, configured as mirrored RAID 1. There are also two separate discs stored off site. Once every week one of these disks will be swapped with one in the RAID. The RAID will automatically update the disc.

Thursday 19 February 2009

Sendmail changes and correct setup on Linux server

I'm doing some modifying of a PHP script which now needs to be able to send emails. The script (todolist.php) runs on the local Linux server, and is only used internally.

I ran 'sendmailconfig' on the Linux server, this suggested I altered /etc/mail/sendmail.mc. I used the public address of our local SMTP server (Mac Server). After entering this info sendmailconfig continued and reset sendmail.

Immediately emails from the queue started coming in! Pretty cool, and easy!

Wednesday 18 February 2009

Extra backup routine for SuperDuper

Added a backup routine and schedule for the backup tool SuperDuper on the Leopard Server.

The script backups only mailbfr's mailbackup directory located on the Leopard Server's backup drive. The backup, of the backup, is backuped as a disk image to the Linux server in it's backup directory. The backup is scheduled for each day at 04:30.
Automated mailback for the Mac OS X Leopard Server by using the 'mailbfr' tool, works great!

I used to use it manually by running:
mailbfr -b /Volumes/Backups/MailBackup/ -mo rotate

I now ran:
mailbfr -i

Which prompted this:

crontab: no crontab for root
cat: /etc/crontab: No such file or directory
There IS NO cron job for mailbfr
if you want to use 'mailbfr' it is recommended that this be added
Would you like me to enable it for you (yes/no)
yes
What time would you like the job to run (24-hour format)?
Please enter the hour (1)
2
Please enter the minutes (0)

Enter the path you would like to backup to? Enter for default (/mailbfrBackups)
/Volumes/Backups/MailBackup
Enter the type of backup you would like? (incremental/full/rotate) Enter for default (incremental)
rotate
The following cron job for 'mailbfr' has been prepared
0 2 * * * /usr/sbin/mailbfr -b /Volumes/Backups/MailBackup --mode rotate
Would you like to add it? (yes/no)
yes
crontab: no crontab for root
The following cron job for 'mailbfr' has been enabled'
0 2 * * * /usr/sbin/mailbfr -b /Volumes/Backups/MailBackup --mode rotate


Backups are now made daily at 02:00 and are stored on the extra backup drive in the Leopard server. The 'rotate' option is used, which means that each day the backup is updated, and is rotated on Saturday.