Operating System - HP-UX
1752675 Members
5522 Online
108789 Solutions
New Discussion

files to be moved from HP-UX machine to Linux machine

 
MADHU-CA
Advisor

files to be moved from HP-UX machine to Linux machine

Hi ,,

 

I need a help in implementing the below idea.

 

1.When ever a new file is created in hp ux server it should be moved to Linux machine and once the file is moved,file shoukd be removed in Linux machine.

 

How can I implement it.

 

1.I can create a ssh key and share it across server.

2.create a cronjob to touch a file for every one hour and if any new file created within that time period move it to the linux server and delete it once the file is successfully moved.

3.finally remove the test file.

 

will my above plan work ?

 

 

5 REPLIES 5
Dennis Handly
Acclaimed Contributor

Re: files to be moved from HP-UX machine to Linux machine

>How can I implement it?

 

Can files be shared over NFS?

 

>1. I can create a ssh key and share it across server.

 

Then you can use scp to copy the files.

>2. create a cronjob to touch a file for every one hour and if any new file created within that time period move it to the linux server and delete it once the file is successfully moved.

 

By that file, are you talking about a reference file that you can use with find(1)?

What you want is to create a NEW reference file and use find with the previous reference file.

Then at the end of the cronjob, move NEW to OLD reference file.

>3. finally remove the test file.

 

Why?  Save it for next time.

MADHU-CA
Advisor

Re: files to be moved from HP-UX machine to Linux machine

Due to security reason,NFS port opening was denied,so we have to move files from one server to another server.

 

I need a move a newly created file for every one hour to another server.

 

how can be it done ?

Dennis Handly
Acclaimed Contributor

Re: files to be moved from HP-UX machine to Linux machine

>I need a move a newly created file for every one hour to another server.

 

As I mentioned, you can use find with a reference file to find newly modified files and scp to copy them.

SoumitraC
Frequent Advisor

Re: files to be moved from HP-UX machine to Linux machine

Yes, scp followed by a ssh command to remove the files would be a good option.

 

However, I don't quite understand the need for a reference file if you are removing the files after the copy. Just 'find' files created since the last time your 'scp' ran?

 

If ftp is allowed, you can also setup file mirroring to achieve the same (see lftp http://lftp.yar.ru/).

 

Soumitra C
HP-UX Compilers
Dennis Handly
Acclaimed Contributor

Re: files to be moved from HP-UX machine to Linux machine

>followed by a ssh command to remove the files

 

No need for ssh, since files are on the local system.

 

>I don't quite understand the need for a reference file if you are removing the files after the copy. Just 'find' files created since the last time your scp ran?

 

Unless you're saying the directories only have the files to copy since they are removed after copying, the only way to find files, with granularity in seconds, is to use a reference file.  -mtime is in days.

Unless gnu find has magic.