Backup transfer scripts for Linux to Windows

Hi folks!!!

This script will help you in understanding how to transfer the backup from a linux machine to windows. This is a small sample script you have to really tweak into it for a full proof system.
Step1: Create a share directory on windows machine

Step2: Create the script on your linux machine

#! /usr/local/bin

# specify the backup folder

# attach timestamp if required
# timestamp=`date +%d%m%y`
# dir=”$des”user1″$timestamp”

# Check if the backup source exist
if [ ! -d “$backup_src” ] ; then
echo “backup not possible directory does not exist”
echo “Source directory does not exist” | mail -s “Backup not possible: ”
# Mount the windows share point to transfer the backup
mount -t smbfs -o username=vyvaks,password=vyvaks // /mnt/backupStore/
if [ $? != 0 ]
echo ” Mount error ”
echo ” Mount error ” | mail -s “Backup not possible: ”
sleep 2
# copy the backup to mount point
cp -r $backup_src /mnt/bkup
if [ $? != 0 ]
echo “Copy Failed” | mail -s “Backup not possible: ”
umount /mnt/bkup
# Unmount the windows mount point
umount /mnt/bkup
echo “Backup sucessfully transfered” | mail -s “Backup done : ”

Step 3: Finally for scheduling add the script to the cron


3 thoughts on “Backup transfer scripts for Linux to Windows

  1. Hello! I know this is somewhat off topic but I was wondering if you knew where
    I could find a captcha plugin for my comment form?
    I’m using the same blog platform as yours and I’m having difficulty finding one?

    Thanks a lot!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s