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
Solved

unix copy

Posted on 2011-02-25
9
454 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
  • 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.

829 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