How to Backup your data on to a shared network drive

This post was written by admin on September 15, 2009
Posted Under: Backup, Internet

In this tutorial shows how to backup your home directory to a remote drive along with a list of sources and installed packages.There’s also a GUI tool that make backups to remote host.
First,open a terminal window and type this command:

sudo aptitude install smbclient smbfs

Configure your network drive properly and make sure you can connect to it. Also record the IP Address of the network disk.
Create the mountpoint for the backup drive by this command:

sudo mkdir /media/backup

Create a shell script by this command:

gedit network_backup

and paste following code,then save it.

#!/bin/bash
cd
yes "your password here" | sudo -S cp /etc/apt/sources.list .
dpkg --get-selections > installed-software
yes "your password here" | sudo -S smbmount //IP address/share name /media/backup -o username=network_username,password=network_password,uid=1000,mask=000
rsync -arquz --exclude=Music --exclude=Videos --exclude=Pictures --exclude=Dropbox --exclude=Examples --exclude=.VirtualBox --exclude=.beagle --exclude=.cache --exclude=.icons --exclude=.evolution --exclude=Skype\ Calls --exclude=tabla\ lessons --exclude=.thumbnails --delete /home/your_username_here /media/backup/
yes "your password here" | sudo -S smbumount /media/backup
exit

Replace the bolded items only with appropriate values. For the rsync options,just change which paths you want excluded.

Now,make this script executable:

sudo chmod +x network_backup

and start backup by:

./network_backup

You can install Scheduled Tasks,and schedule this backup script to run however often you wish.

sudo aptitude install gnome-schedule

original text from here.

Related posts:

  1. Backup and Restore Ubuntu system with Sbackup
  2. Make backups to Local system,CDs/DVDs,Network with pyBackPack in Ubuntu Linux
  3. Simple Backup tool for Ubuntu
  4. Create backup of all installed packages in ubuntu
  5. Fix DSL pppoe connection problem with Network Manager in Ubuntu 9.10

    Tags:

    Add a Comment

    required, use real name
    required, will not be published
    optional, your blog address