Solved

unix copy

Posted on 2011-02-25
9
468 Views
Last Modified: 2012-05-11
I have a HP-UX box and I copy each night to a mounted NFS share on a linux Ubuntu box. i currently use just a simple copy command

cp -r /source /destination

i would like to be a bit more fancy, and just copy files that changed during the week, and maybe the whole thing each weekend. is there a way to copy just the files that have changed since the last time i ran

cp -r /source /destination

?
0
Comment
Question by:JeffBeall
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 125 total points
ID: 34980850
Hi,

have a look at rsync:

http://rsync.samba.org/

wmp
0
 
LVL 4

Expert Comment

by:FastSi
ID: 34980886
Rsync may do just what you need http://samba.anu.edu.au/rsync/features.html
0
 
LVL 10

Assisted Solution

by:Martin_J_Parker
Martin_J_Parker earned 125 total points
ID: 34980933
After you do the copy, update a file, then use the date/time of that file to search for newer files next time!

For example:

First time you do the copy:
cp -r /source /destination
touch updatefile

Now updatefile has a date/time stamp just after the copy.
The next time you can use find to locate and copy all files which have been updated since that touch

find /source -newer updatefile -exec cp {} /destination \;
touch updatefile

Each subsequent day you just keep doing the find and touch.
On weekends you do the full copy and touch.
Simples!
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
LVL 30

Assisted Solution

by:Kerem ERSOY
Kerem ERSOY earned 125 total points
ID: 34980956
The first time you've used rsync it will copy all files. In the second time it will change only the files that are changed.


rsynv -av /source /destination

should do.

Cheers,
K.
0
 
LVL 1

Author Comment

by:JeffBeall
ID: 34982143
does rsync work with HP-UX? or is it a linux thing?
0
 
LVL 4

Expert Comment

by:FastSi
ID: 34982242
I believe so but you will need to get the source and compile it using make I believe, have never used HP-UX
0
 
LVL 4

Assisted Solution

by:FastSi
FastSi earned 125 total points
ID: 34982247
0
 
LVL 1

Author Closing Comment

by:JeffBeall
ID: 34982306
thank you, i think this will work. i'll just put rsync on my Ubuntu box. that will be much safer. then i could share the directories i need on the HP-UX box then use rsync to copy the file from HP to linux. If this doesn't work, i could try Martin J Parker's suggestion.
Thanks for the help.
0
 
LVL 30

Expert Comment

by:Kerem ERSOY
ID: 34993656
You must already have rsync by default in your ubuntu box.
0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

623 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