Backup of files using NFS a faster way


Login or Register to Reply

 
Thread Tools Search this Thread
# 8  
Old 04-02-2016
I have finished testing rsync and it works like a charm. As promised, below is the finished shell script.

Code:
#!/bin/sh
# *********************************************************************
# *
# * Script Name : sysbck
# *
# * Description : Performs system backup to a remote NSF share
# *
# *********************************************************************
# *   Copyright 2015-20xx by Trolley Computers
# *********************************************************************

# *********************************************************************
# *	V A R I A B L E S
# *********************************************************************

# *********************************************************************
# *	F U N C T I O N S
# *********************************************************************

# *********************************************************************
# *	E R R O R   H A N D L I N G
# *********************************************************************

# *********************************************************************
# *	M A I N   S C R I P T
# *********************************************************************

    echo ==============================
    date
    echo ==============================
#
# Mount Remote NSF Share
#
    echo ""
    echo "Mount Remote NSF Share"
    echo ""

    /etc/mount /mnt/provmed
    sleep 3

    df -v
    echo ""
    echo ""
#
# Backup Files
#
    echo ""
    echo "Backup Files..."
    echo ""

    /usr/local/bin/rsync -vruog --delete /u2/* /mnt/provmed/.

    echo ""
    echo ""
#
# Un-Mount Remote NSF Share
#
    cd
    echo ""
    echo "Un-Mount Remote NSF Share"
    echo ""

    /etc/umount /mnt/provmed

    echo ==============================
    date
    echo ==============================

# *********************************************************************
# *	E X I T   S C R I P T
# *********************************************************************

# 9  
Old 04-21-2016
Consider adding -p and -t options to also preserve permissions and time.
Or use rsync -auvH that will also preserve links and other special files (something that cp -rp cannot do).
-a means archive, see
Code:
man rsync

# 10  
Old 04-21-2016
I have added the -t and -p qualifiers to my script.

Thanks to all that responded.
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Need help for faster file read and grep in big files reldb UNIX for Advanced & Expert Users 3 06-09-2018 05:45 AM
How to backup a directory (sub-directories/files) files from one server on to other ? System Admin 77 AIX 5 09-11-2015 04:25 PM
GTAR - new ways to faster backup - help required Bharath_79 AIX 8 06-10-2014 10:32 AM
GTAR - new ways for faster backup - help required Bharath_79 AIX 2 05-22-2014 03:17 AM
Faster command to remove headers for files in a directory alexcol Shell Programming and Scripting 5 11-13-2012 09:17 PM
Faster Line by Line String/Date Comparison of 2 Files agentgrecko Shell Programming and Scripting 4 07-10-2012 04:43 AM
rsync backup mode(--backup) Are there any options to remove backup folders on successful deployment? MVEERA Shell Programming and Scripting 0 11-23-2011 12:27 PM
Running rename command on large files and make it faster shoaibjameel123 Shell Programming and Scripting 6 08-23-2011 03:55 PM
NFS files after reboot thecobra151 AIX 1 07-11-2011 08:16 AM
NFS mounted files Harleyrci Solaris 12 10-08-2010 03:25 PM
NFS Files system and df command dashok.83 UNIX for Advanced & Expert Users 1 04-25-2010 02:07 AM
remove .nfs and .swp files northwest Shell Programming and Scripting 1 09-25-2009 12:29 AM
backup to NFS mount Redhat-Solaris Stin UNIX for Dummies Questions & Answers 9 05-15-2008 06:17 AM
Faster Concatenation of files tkbharani UNIX for Advanced & Expert Users 1 06-26-2007 11:45 AM
Backup system to NFS Appliance device sirhisss UNIX for Dummies Questions & Answers 10 09-03-2003 12:24 PM