![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Open .zip file created in UNIX | sam99 | UNIX for Dummies Questions & Answers | 5 | 07-04-2008 07:58 AM |
| Setting link to newly installed Java version | harjitsingh | SUN Solaris | 4 | 05-28-2008 11:25 AM |
| Newly created files default group and write permissions | goldfish | UNIX for Dummies Questions & Answers | 2 | 02-20-2008 06:39 PM |
| How to empty a file(already created) | laknar | Shell Programming and Scripting | 4 | 07-04-2007 01:00 PM |
| file was created before 15 days ago. | YoungBlood | UNIX for Dummies Questions & Answers | 1 | 03-02-2007 01:23 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
An application running on HP-UX constantly generates new text log files ( I think using logpipe ). Any new file created requires to be ftp'ed to an offline server, however I want to make sure that the current file being written should not be transferred.
For examples consider the following files on HP-UX server that are transferred to an offline server for processing. file1 - old already transferred at T1 file2 - old already transferred at T1 file3 - old already transferred at T1 file4 - new needs to be transferred at T2 file5 - new needs to be transferred at T2 file6 - new needs to be transferred at T2 file7 - new needs to be transferred at T2 file8 - new needs to be transferred at T2 file9 - file currently open by application for writing ( don't include this file for transfer at T2, this will be transferred at T3 when the file is close) Also the script that ftp's the files run on the remote offline server. Is there a command that can be run from remote server that will help identify all the new files but prevent the current open file from getting transferred? thanks |
|
||||
|
I doubt whether UNIX has built in commands for these requriements. I see two queries here.
1) 'Already FTPed files' not be FTPed again :- Two solutions 1) Record the timings of when ever FTP command runs. Then always pick the files later than last run FTP command. 2) If remote host has permission to move/rename the files then as soon as they got FTPed move/rename them to some other format other than FTP files format. But in real scenarios it is very unlikely that remote host would be having permissions to move/rename files. 2) Not to pick the current growing file:- Assuming only one file is open for writing at any time, why dont you just leave the latest file (ignore file 'ls -lrt | tail -1')? |
|
||||
|
You can check to see if any file has a particular file open using the lsof command.
lsof filename produces no output if no process has that file open. If you're running on Solaris then you can also use the 'fuser' command in the same way. Unfortunately these must both be run on the local server. So you must run them there or via 'trusted' rsh/ssh connections. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|