Unix/Linux Go Back    


SCO Santa Cruz Operation (SCO) was a software company based in Santa Cruz, California which was best known for selling three UNIX variants for Intel x86.

Backup of files using NFS a faster way

SCO


Tags
backup, nfs, rsync, solved

Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 02-27-2016
trolley's Unix or Linux Image
trolley trolley is offline
Registered User
 
Join Date: Dec 2013
Last Activity: 14 March 2017, 11:23 AM EDT
Location: Medway, Massachusetts
Posts: 28
Thanks: 4
Thanked 1 Time in 1 Post
Backup of files using NFS a faster way

Hi All!

i am trying to copy files from a SCO Openserver 5.0.6 to a NAS Server using NFS. I have a cron job that takes 1.5 hours to run and most of the data is static. I would like to find a faster way. In the event I needed to running manually or avoid an issue with taking down the servers due to thunderstorms. Below is a copy of the shell script.

Any help will be much appreciated.



Code:
# ********************************************************************
# *
# * Script Name : sysbck
# *
# * Description : Performs system backup to a remote NSF share
# *
# *********************************************************************
# *   Copyright 2015-20xx by Trolley Computers
# *********************************************************************
#!/bin/sh
# *********************************************************************
# *	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/pmsroot
    sleep 3

    echo ""
    echo ""
    df -v

#
# Remove Specific Directories
#
    echo ""
    echo "Remove Specific Directories"
    echo ""

    cd /mnt/pmsroot

    rm -fr /mnt/pmsroot/bin
    rm -fr /mnt/pmsroot/ecs
    rm -fr /mnt/pmsroot/angrist
    rm -fr /mnt/pmsroot/fercho
    rm -fr /mnt/pmsroot/huppert
    rm -fr /mnt/pmsroot/nena
    rm -fr /mnt/pmsroot/sc60
    rm -fr /mnt/pmsroot/trolley

    echo ""
    lc
#
# Backup Files
#
    echo ""
    echo "Backup Files..."
    echo ""

    cp -Rp /u2/* /mnt/pmsroot/.

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

    /etc/umount /mnt/pmsroot

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

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


Last edited by Scrutinizer; 02-29-2016 at 01:57 PM.. Reason: NSF-> NFS
Sponsored Links
    #2  
Old Unix and Linux 02-28-2016
Peasant's Unix or Linux Image
Peasant Peasant is offline Forum Advisor  
Registered User
 
Join Date: Mar 2011
Last Activity: 24 March 2017, 12:05 PM EDT
Posts: 1,028
Thanks: 28
Thanked 294 Times in 257 Posts
Well the only way to speed up the process is not to copy entire hierarchy every time a script is ran.

Have you considered using rsync , since the data is static it will only copy changes every time it is ran ?
Using rsync the script will probably be couple of lines long.

How big is the directory (size and number of files) and how much bandwidth do you have ?

Perhaps you could also speed up the process with various mount options for NFS or setting atime off for the source mountpoint, but one can only guess.

Other approach is to have a checksum table of all files (source and destination) in perhaps sqlite3 database or a plain text file which you will ran you script against so it only copies the changes.
This will require a bit more effort tho unlike couple of rsync lines Linux

Hope that helps
Regards
Peasant.
Sponsored Links
    #3  
Old Unix and Linux 02-28-2016
jgt's Unix or Linux Image
jgt jgt is offline Forum Advisor  
Registered User
 
Join Date: Apr 2007
Last Activity: 17 March 2017, 3:52 PM EDT
Location: 44.21.48N 80.50.15W
Posts: 1,929
Thanks: 2
Thanked 250 Times in 236 Posts
rsync is available from the skunkware section on the sco site.
    #4  
Old Unix and Linux 02-28-2016
Scrutinizer's Unix or Linux Image
Scrutinizer Scrutinizer is offline Forum Staff  
Moderator
 
Join Date: Nov 2008
Last Activity: 24 March 2017, 11:16 AM EDT
Location: Amsterdam
Posts: 11,331
Thanks: 479
Thanked 3,247 Times in 2,864 Posts
Also, the script posted in post #1 appears to be using a single NAS backup volume (defined in /etc/fstab). IMO an approach like this should only be used if there are multiple backup NAS volumes, either taken from the host itself or from the NAS volume.

Otherwise this would not be a secure way of doing it, since it first wipes the old backup before making a new one, so if anything happens during that backup you end up with nothing..
Sponsored Links
    #5  
Old Unix and Linux 02-28-2016
trolley's Unix or Linux Image
trolley trolley is offline
Registered User
 
Join Date: Dec 2013
Last Activity: 14 March 2017, 11:23 AM EDT
Location: Medway, Massachusetts
Posts: 28
Thanks: 4
Thanked 1 Time in 1 Post
I did not find rsync on the Skunkware website for OSR5. I did download, compile and install version 3.1.2 from the website for Rsync. I am going to need to learn how to use it.

I did notice on my NAS device, there is a service called rsync.

Yes, I need to have a better backup, where I am not messing with previous days backup. I was trying to get something quick and dirty done. I now need to work on something more secure and beneficial to me.

Thanks for all the suggestions and comments.
Sponsored Links
    #6  
Old Unix and Linux 02-28-2016
bakunin bakunin is offline Forum Staff  
Bughunter Extraordinaire
 
Join Date: May 2005
Last Activity: 24 March 2017, 10:18 AM EDT
Location: In the leftmost byte of /dev/kmem
Posts: 5,377
Thanks: 98
Thanked 1,477 Times in 1,097 Posts
Just a minor observation. This:
Quote:
Originally Posted by trolley View Post

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

won't work because "#! /some/shell" is only supported in the first line, nowhere else.

I hope this helps.

bakunin
Sponsored Links
    #7  
Old Unix and Linux 02-29-2016
trolley's Unix or Linux Image
trolley trolley is offline
Registered User
 
Join Date: Dec 2013
Last Activity: 14 March 2017, 11:23 AM EDT
Location: Medway, Massachusetts
Posts: 28
Thanks: 4
Thanked 1 Time in 1 Post
I started playing around with rsync and it has promise. Much faster than the way I am doing it. I post the final shell script when done.
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
GTAR - new ways to faster backup - help required Bharath_79 AIX 8 06-10-2014 09:32 AM
GTAR - new ways for faster backup - help required Bharath_79 AIX 2 05-22-2014 02:17 AM
backup to NFS mount Redhat-Solaris Stin UNIX for Dummies Questions & Answers 9 05-15-2008 05:17 AM
Faster Concatenation of files tkbharani UNIX for Advanced & Expert Users 1 06-26-2007 10:45 AM
Backup system to NFS Appliance device sirhisss UNIX for Dummies Questions & Answers 10 09-03-2003 11:24 AM



All times are GMT -4. The time now is 03:53 PM.