Sponsored Content
Top Forums Shell Programming and Scripting Check if file is loaded completely and then process the file Post 302328742 by cambridge on Thursday 25th of June 2009 06:26:35 AM
Old 06-25-2009
How do you know if the file is loaded completely?

Well, if you can mark the last line of the file with something, you could check for that with 'tail -1', and process it if that line exists.

Alternatively, you could get the FTP process to upload a marker file first, then delete that marker file once the main file is uploaded. You could then check for the marker file.

Or, you could watch the size of the file over say a 30 second interval. If the file size has remained static in that time, you could assume that no FTP process is writing to it anymore.

Do any of these suggestions help you?

Last edited by cambridge; 06-29-2009 at 05:35 AM.. Reason: Typo
 

10 More Discussions You Might Find Interesting

1. Filesystems, Disks and Memory

some process writin file - check if complete

Hi folks... some process is writing a file.... as soon as the process starts the file comes there, and its growin.. now i in another script want to ftp the file. i don't know if the file is complete or not. the process which writes the file is some other application and hence can't... (0 Replies)
Discussion started by: sade
0 Replies

2. UNIX for Dummies Questions & Answers

How to find File copied completely or else ...

In Unix, I am having one file getting copied to some directory. Which command will help me ensure, that file is not completely copied to the disk? (2 Replies)
Discussion started by: videsh77
2 Replies

3. Shell Programming and Scripting

waiting until file loaded

Hello i have DB file load with this command ../SS-Tools/SSdbload -r 10 -il /export/specbackup_db/$b y i should wait until the DB load completed then run the next command $SPECROOT/bin/launchinstdbapp `/usr/bin/hostname` SS n VNM.OUT how this can be done with shell scripting NB: i... (1 Reply)
Discussion started by: mogabr
1 Replies

4. UNIX for Advanced & Expert Users

Using FTP to check whether file is completely FTP... plz find the description below

Hi, We have some clients who will place huge files in to one of the remote server. And the shell script written in our local server to retrieve client files (using FTP) placed on one of the remote server of ours by clients. My question Is there any FTP command/script to check from my local... (1 Reply)
Discussion started by: nmsrao
1 Replies

5. UNIX for Advanced & Expert Users

Check EOF char in Unix. OR To check file has been received completely from a remote system

Advance Thanks. (1) I would like to know any unix/Linux command to check EOF char in a file. (2) Or Any way I can check a file has been reached completely at machine B from machine A. Note that machine A ftp/scp the file to machine B at unknown time. (5 Replies)
Discussion started by: alexalex1
5 Replies

6. Shell Programming and Scripting

To check wheather a file is downloaded completely or not

I will have two files (which were in .txt format) ftp'ed to a specified directory, from where my ksh picks up each file at a time and starts processing it. So i need to write a script which as soon as find a file should check wheather it is download completely or not. If it is still downloading... (2 Replies)
Discussion started by: vpv0002
2 Replies

7. Shell Programming and Scripting

check if some file is in copy process, then transfer it

my user copy large files, and it's take 10min for file to be copied to the server (/tmp/user/ files/), if in the meantime start my scheduled script, then it will copy a part of some file to server1 my idea is to check the file size twice in a short period (1-2 seconds) of time, then compare, if... (5 Replies)
Discussion started by: waso
5 Replies

8. Solaris

file just loaded does not appear to be executable

Hi When i m trying the boot the system with Primary HDD (c1t0d0s0) -- its solaris 10 I m getting an error "file just loaded does not appear to be executable".....So will anyone share the steps to recover from this stage I also tried to build the corrupted superblock from below command but... (0 Replies)
Discussion started by: taruntan
0 Replies

9. Shell Programming and Scripting

SQLLDR :Data not loaded completely

Hi , I am using below control file LOAD DATA APPEND INTO TABLE LSHADMIN.EG TRAILING NULLCOLS ( STUDY CHAR ) and the text file to load data is CACZ885M2301 When I run below command: sqlldr userid=apps/apps control=/home/appsuser/dataload/ctl_file.ctl... (3 Replies)
Discussion started by: Pratiksha Mehra
3 Replies

10. UNIX for Beginners Questions & Answers

Pid file and process check

Hello, I am running ubuntu14.04 What I am trying to do is restart a process with a shell when pid is dead. I restored pid nr in a file and check with ps aux | grep -v grep | grep $(cat *.pid)| awk '{ print $2 }' While surfing on google, I have found an answer saying that restoring pid in a... (2 Replies)
Discussion started by: baris35
2 Replies
Restart Markers(3)						 globus ftp client						Restart Markers(3)

NAME
Restart Markers - Data Structures union globus_ftp_client_restart_marker_t Restart marker. Functions globus_result_t globus_ftp_client_restart_marker_init (globus_ftp_client_restart_marker_t *marker) globus_result_t globus_ftp_client_restart_marker_copy (globus_ftp_client_restart_marker_t *new_marker, globus_ftp_client_restart_marker_t *marker) globus_result_t globus_ftp_client_restart_marker_destroy (globus_ftp_client_restart_marker_t *marker) globus_result_t globus_ftp_client_restart_marker_insert_range (globus_ftp_client_restart_marker_t *marker, globus_off_t offset, globus_off_t end_offset) globus_result_t globus_ftp_client_restart_marker_set_ascii_offset (globus_ftp_client_restart_marker_t *marker, globus_off_t offset, globus_off_t ascii_offset) globus_result_t globus_ftp_client_restart_marker_set_offset (globus_ftp_client_restart_marker_t *marker, globus_off_t offset) globus_result_t globus_ftp_client_restart_marker_get_total (globus_ftp_client_restart_marker_t *marker, globus_off_t *total_bytes) globus_result_t globus_ftp_client_restart_marker_to_string (globus_ftp_client_restart_marker_t *marker, char **marker_string) globus_result_t globus_ftp_client_restart_marker_from_string (globus_ftp_client_restart_marker_t *marker, const char *marker_string) Detailed Description FTP Restart Markers. The Globus FTP Client library provides the ability to start a file transfer from a known location into the file. This is accomplished by passing a restart marker to the globus_ftp_client_get(), globus_ftp_client_put(), or globus_ftp_client_third_party_transfer() functions. Function Documentation globus_result_t globus_ftp_client_restart_marker_init (globus_ftp_client_restart_marker_t *marker) Initialize a restart marker. Parameters: marker New restart marker. See also: globus_ftp_client_restart_marker_t, globus_ftp_client_restart_marker_destroy() globus_result_t globus_ftp_client_restart_marker_copy (globus_ftp_client_restart_marker_t *new_marker, globus_ftp_client_restart_marker_t *marker) Create a copy of a restart marker. This function copies the contents of marker to new_marker. Parameters: new_marker A pointer to a new restart marker. marker The marker to copy. See also: globus_ftp_client_restart_marker_init(), globus_ftp_client_restart_marker_destroy() globus_result_t globus_ftp_client_restart_marker_destroy (globus_ftp_client_restart_marker_t *marker) Destroy a restart marker. Parameters: marker Restart marker. This marker must be initialized by either calling globus_ftp_client_restart_marker_init() or globus_ftp_client_restart_marker_copy() See also: globus_ftp_client_restart_marker_t, globus_ftp_client_restart_marker_init(), globus_ftp_client_restart_marker_copy() globus_result_t globus_ftp_client_restart_marker_insert_range (globus_ftp_client_restart_marker_t *marker, globus_off_toffset, globus_off_tend_offset) Insert a range into a restart marker This function updates a restart marker with a new byte range, suitable for using to restart an extended block mode transfer. Adjacent ranges within the marker will be combined into a single entry in the marker. The marker must first be initialized by calling globus_ftp_client_restart_marker_init() or globus_ftp_client_restart_marker_copy(). A marker can only hold a range list or a stream offset. Calling this function after calling globus_ftp_client_restart_marker_set_offset() will result in a marker suitable only for use restarting an extended block mode transfer. Parameters: marker A restart marker offset The starting offset of the range. end_offset The ending offset of the range. See also: globus_ftp_client_restart_marker_set_offset() globus_ftp_client_operationattr_set_mode() globus_result_t globus_ftp_client_restart_marker_set_ascii_offset (globus_ftp_client_restart_marker_t *marker, globus_off_toffset, globus_off_tascii_offset) Set the offset for a restart marker. This function modifies a restart marker to contain a stream offset, suitable for using to restart a steam mode transfer. The marker must first be initialized by calling globus_ftp_client_restart_marker_init() or globus_ftp_client_restart_marker_copy(). A marker can only hold a range list or a stream offset. Calling this function after calling globus_ftp_client_restart_marker_insert_range() will delete the ranges associated with the marker, and replace it with a marker suitable only for use restarting a stream mode transfer. When restarting an ASCII type transfer, use globus_ftp_client_restart_marker_set_ascii_offset() to set both the offset used in the local representation of an ACSII file, and the network representation of the ASCII file. For UNIX systems, the former includes counts newlines as one character towards the file offset, and the latter counts them as 2 characters (CRLF). Parameters: marker A restart marker offset The local stream offset. ascii_offset The network ascii representation of the offset. See also: globus_ftp_client_restart_marker_insert_range(), globus_ftp_client_restart_marker_set_offset(), globus_ftp_client_operationattr_set_mode(), globus_ftp_client_operationattr_set_type() globus_result_t globus_ftp_client_restart_marker_set_offset (globus_ftp_client_restart_marker_t *marker, globus_off_toffset) Set the offset for a restart marker. This function modifies a restart marker to contain a stream offset, suitable for using to restart a steam mode transfer. The marker must first be initialized by calling globus_ftp_client_restart_marker_init() or globus_ftp_client_restart_marker_copy(). A marker can only hold a range list or a stream offset. Calling this function after calling globus_ftp_client_restart_marker_insert_range() will delete the ranges associated with the marker, and replace it with a marker suitable only for use restarting a stream mode transfer. When restarting an ASCII type transfer, the offset must take into account the additional carriage return characters added to the data stream. Parameters: marker A restart marker offset The stream offset See also: globus_ftp_client_restart_marker_insert_range(), globus_ftp_client_operationattr_set_mode(), globus_ftp_client_operationattr_set_type() globus_result_t globus_ftp_client_restart_marker_get_total (globus_ftp_client_restart_marker_t *marker, globus_off_t *total_bytes) Get total bytes accounted for in restart marker This funtion will return the sum of all bytes accounted for in a restart marker. If this restart marker contains a stream offset then this value is the same as the offset (not the ascii offset) that it was set with. If it is a range list, it a sum of all the bytes in the ranges. Parameters: marker A previously initialized or copied restart marker total_bytes pointer to storage for total bytes in marker Returns: o Error on NULL marker or total bytes o <possible return>=''> globus_result_t globus_ftp_client_restart_marker_to_string (globus_ftp_client_restart_marker_t *marker, char **marker_string) Create a string representation of a restart marker. This function sets the marker_string parameter to point to a freshly allocated string suitable for sending as an argument to the FTP REST command, or for a later call to globus_ftp_client_restart_marker_from_string(). The string pointed to by marker_string must be freed by the caller. Parameters: marker An initialized FTP client restart marker. marker_string A pointer to a char * to be set to a freshly allocated marker string. See also: Restart Markers globus_result_t globus_ftp_client_restart_marker_from_string (globus_ftp_client_restart_marker_t *marker, const char *marker_string) Initialize a restart marker from a string. This function initializes a new restart, marker, based on the marker_string parameter. The string may be either a single offset for a stream-mode restart marker, or a comma-separated list of start-end ranges. Parameters: marker The restart marker to be unitialized. marker_string The string containing a textual representation of a restart marker. See also: Restart Markers Author Generated automatically by Doxygen for globus ftp client from the source code. Version 7.3 Mon Apr 30 2012 Restart Markers(3)
All times are GMT -4. The time now is 03:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy