Solved

HPUX

Posted on 2011-03-19
6
520 Views
Last Modified: 2012-05-11
i need to copy an entire directory to a nfs share - then I would like to copy only the changed filed to the nfs share. to copy only the changed files - so far i have this

find / -type f -xdev -mtime -1 -print | xargs ll | sort -rn -k5

I was wondering if it would work to pipe this find's output into a file - then somehow use the file to use the rcp command to copy only the changed files to my nfs share, would this be possible?
0
Comment
Question by:JeffBeall
  • 2
  • 2
  • 2
6 Comments
 
LVL 38

Expert Comment

by:yuzh
ID: 35174944
FYI, you don't need to use "| xargs ll | sort -rn -k5"

you can direct the output of the find command to a file for later use.

eg:
find / -type f -xdev -mtime -1 -print >/tmp/myfilelist

and create a tar ball for the files in the list
tar -cvf /tmp/mtfile.tar `cat /tmp/myfilelist`

to make backup and restore easier, you should use related path to create the list.
eg
cd /
find . -type f -xdev -mtime -1 -print >/tmp/myfilelist

you can also use find + cp to copy files in one go, pleae look at the example
in http:Q_22575711.html

for more details.
Have a nice weekend!
0
 
LVL 40

Expert Comment

by:jlevie
ID: 35175669
There's a better way. Use rync to copy the changed files. As an example if /mnt/target is the nfs mount point and /home/files is the directory to be mirrored to the nfs mount point, the following command will sync the two directories:

rsync -av --delete /home/files/ /mnt/nfs

See "man rsync" for more information.
0
 
LVL 1

Author Comment

by:JeffBeall
ID: 35177056
I don't have rsyn. It is not in HPUX which is what my server runs.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 40

Accepted Solution

by:
jlevie earned 250 total points
ID: 35177309
Download the sources from http://rsync.samba.org/download.html and build & install it.
0
 
LVL 38

Assisted Solution

by:yuzh
yuzh earned 250 total points
ID: 35177585
agreed with jlevie, rsync is a better tool for backup.

You can downlaod the binary package for HP-UX from:
http://hpux.connect.org.uk/hppd/hpux/Networking/Admin/rsync-3.0.7/

Please remember to download and install all the dependencies packages. (just follow the links in the download page).
0
 
LVL 1

Author Closing Comment

by:JeffBeall
ID: 35180632
thank you
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Best Linux Distro for this software 10 58
ftpcommand 2 50
Move nodes from one TSM to another. 3 51
Unix Question 19 40
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now