Monday, January 23, 2012

Efficient Linux/Ubuntu Backup System

Creating a shared folder backup system that's fast and reliable is hard with Windows. Using xcopy copies and replaces all files (which isn't necessary unless the files are new or have been modified since last backup) and using an external programs like Veritas can be a lengthy process as well. The compay we initially created this system for was backing up nearly 500gb of data daily. We sought out a way to avoid this using a computer built from old spare parts, an external drive made from spare parts**, and a free operating system - Ubuntu (xfce release is the one we prefer, but you could do the same with any of them).

After we got Xubuntu installed on the tower, we installed samba file sharing as our root login (the user created when the operating system was installed, not our network user, then ran sudo apt-get install samba). By this time we added the computer name and a testuser to the Active Directory and allowed it administrative privileges. After restarting the linux machine, log in as the network user by clicking "Other" and typing the full user name - for example: "NETWORKNAME\testuser" and enter that user's password that was applied in the Active Directory user set up. Now that a local user has been created on the computer, we log off and log back in as the root to allow our new user root privileges. Once that has been done we are ready to map the network drives.

We then created folders in the /media directory to map the network folders to. We added the network paths to fstab (sudo gedit /etc/fstab) of the folder we wanted to map and back up. An example line from that file is:
"//192.168.0.121/E$ /media/edrive cifs username=user,password=pass 0 0"

Once you get all of them into fstab, save and close that file then run the command "sudo mount -a" - if you receive any errors, you likely have input something wrong, if not, you should now be able to browse those folders where you mounted them.

Next, we wrote a quick #!/bin/bash script to run the rsync command for those directories to sync with our external backup drive (for example: "rsync -aq /media/edrive /media/backup/edrive"). After, we used the chmod command to make our file useful without without having to use the sudo prefix or enter a password so it could easily be made into a scheduled task to run automatically. For this, we used crontab to set up the task execution frequency/schedule (crontab -e).

With that, we're done. In summary, what we've accomplished is making a faster more efficient backup system by only copying files that are new or have changed since the last time the script was run. Just keep the computer on and let it sit and do all the work for you quickly and efficiently.


*Please note, the examples above will have to be altered slightly to accommodate your setup and also that the first time the script is run it will perform a "full backup" from the specified locations (unless the files already exist in the destination).
**The external drive was the only cost. We purchased a "shell enclosure" and used an extra sata drive that we had from another computer whose motherboard died. Please do make sure the one that you use has enough space to perform the backup before running it.


Wednesday, November 9, 2011

SkiyeLab Computers New Lebanon, NY

SkiyeLab Computers offers computer related services ranging your computer needs at competitive rates. We have over 20 years of combined computer experience to suit your needs. We understand finding a good and reliable computer tech is like finding a good mechanic - once you find one, you stick with them. So why would you switch to us? Well...simply because we're better.

Servicing computers in Pittsfield, MA - New Lebanon, NY and surrounding areas.

Please contact us for more details and solutions to your computer problems.

Services Offered:

  • Computer Repair/Hardware Installation
  • Operating System Upgrade/Install
  • Virus Removal/Computer Diagnostics
  • Web Design and Coding/SEO
  • Graphic Design/Logos
  • Consulting
  • Home and Business Networking
  • Database Management
  • Crystal Reports
  • Data Services (Contact for Specific Details)
  • Server Administration
  • Simple Apps Development
  • Windows, Mac and Linux fluent.
Of course there's more - Contact us for pricing details. We promise to beat the competitors.

Also, check out our awesome PcClean app on sourceforge.net and cnet.com.