?
Solved

unix copy

Posted on 2011-02-25
9
Medium Priority
?
472 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 500 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 500 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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 30

Assisted Solution

by:Kerem ERSOY
Kerem ERSOY earned 500 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 500 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
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…
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.
Suggested Courses

718 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