Solved

unix copy

Posted on 2011-02-25
9
423 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
 
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
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…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

747 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

12 Experts available now in Live!

Get 1:1 Help Now