Sponsored Content
Full Discussion: File queue script
Top Forums Shell Programming and Scripting File queue script Post 74497 by RishiPahuja on Friday 10th of June 2005 06:30:21 AM
Old 06-10-2005
MySQL

Here I give u a backbone to work on...Though I have not tried it... but should work with changes as per your need.

Code:
#!/usr/bin/ksh

#N is the number of files, you wish to wait for.
N=3

#T is time you wish to wait for in seconds.
T=10

#SPECIFIED_TIME time you assume all files have arrived.
SPECIFIED_TIME=2000

START_TIME=`date '+%Y%m%d%H%M%S'
FLAG=0

while 1
do
find $FILE_LOCATION -name $NAME* -exec ls -ltr {} \; > tmpfile
FILE_CNT='wc -l tmpfile | awk '{print $1}'`

if [ $FILE_CNT -ge $N -o $FLAG -eq 1 ]; then
  rm -f bigfile
  for i = 1 to $N
  do 
    file_nm=`head -1 tmpfile | awk '{ print $9 }'`
    sed -n '1d' tmpfile > tmpfile
    cat $file_nm >> bigfile
  done
  
  if [ $FLAG -eq 1 ]; then
    exit
  fi
  
fi

sleep $T

CUR_TIME=`date '+%Y%m%d%H%M%S'
diff=`expr $CUR_TIME - $START_TIME`
if [ $diff > $SPECIFIED_TIME ]; then
 FLAG=1
fi

done

 

10 More Discussions You Might Find Interesting

1. Programming

Queue

:confused: I have some problem with the technology Queue in Unix Can someone explain me the way queue is made and how it excute ,how it run Thanks in advance (1 Reply)
Discussion started by: iwbasts
1 Replies

2. Shell Programming and Scripting

shell script needed for mail queue notification

Hi shell experts, I would like to have a shell script running in a redhat server for monitoring the mailqueue status. I have already installed the qmHandle and I am using it to get a status of the mail queue in daily basis. I am executing the qmhandle in the cron. Now I am planning to execute... (10 Replies)
Discussion started by: Nightman
10 Replies

3. Shell Programming and Scripting

Need Help Writing Script To Email When Fax Queue Goes Down

I need a script that would email me when the fax queue goes down. How would I go about doing this? Our fax queue drops a few times a week and if I don't catch it fairly quickly it gets backed up really fast which makes the users a little unhappy... I am new to Unix-AIX. We are running... (6 Replies)
Discussion started by: ITAdmin08
6 Replies

4. AIX

AIX 6.1 Error - "A file, file system or message queue is no longer available."

Getting a strange error with a log file below. This is just a normal text log file that is written to by an application on the server. The applicaiton is down, however, I cannot read, remove or touch this file. The file shows on an ls listing but not an ls -al listing. The file system is JFS2... (0 Replies)
Discussion started by: troym72
0 Replies

5. AIX

AIX Bunch of printers queue creation script - HELP

I'd seek for help on how to create a bunch of printers in AIX 6.x or equal or above in one go – say like I have 35 printers to create in 4 different AIX Nodes every month – I currently create it manually like below:- How can I automatic this creation on all the 4-5 Nodes – not actually automatic... (3 Replies)
Discussion started by: shiv2001in
3 Replies

6. Shell Programming and Scripting

Detect if script starts from queue

Dear community, what I'm try to do is deny users to run a script without parameters from command bash, but the same script should run without parameters only from crontab. Example runs by crontab:*/5 * * * * /tmp/script.sh Here the normal execution starts every 5 minutes Example #1 runs by... (16 Replies)
Discussion started by: Lord Spectre
16 Replies

7. AIX

Help with clear printer queue script in AIX 5.3

Good day UNIX forum, could you help me with my clear printer queue script, i have problems with the consistency of this function, sometimes it works sometimes it doesn't. Thanks in advance } preRemovePrintQ(){ clear; echo; echo... (1 Reply)
Discussion started by: beware187
1 Replies

8. Shell Programming and Scripting

How to write Perl Script to Get MQ Queue Depth?

Hi , I got the following script from internet to display queue depth using Perl Script. However, when I execute it , im getting following error. Can anyone shed light on what is going wrong? #!/usr/bin/perl ## 07/23/01 ## Depth Inquiry sample program. ## Arguments: ## Connects to... (11 Replies)
Discussion started by: srkmish
11 Replies

9. Shell Programming and Scripting

Shell Script for Websphere MQ Queue Manager start/stop

Hello All, I am completely new to shell scripting. I had to write a script that starts and stop the queue manager in Websphere MQ. We are on Linux 64-bit patform. The script should stop the queue manager and all the processes related to websphere MQ. It should be a clean stop. Once the queue... (3 Replies)
Discussion started by: pady1224
3 Replies

10. Shell Programming and Scripting

MQ Queue Manager SSL Checking Script

Hello everyone, Newbie to the forum. I have a requirement for a script to check Queue Manager SSL certificates - However I have no previous scripting skills what so ever. I need a script which from high level point of view does the following: #For each Queue Manager on the server go to... (1 Reply)
Discussion started by: MQAdmin
1 Replies
DH_COMPRESS(1)							     Debhelper							    DH_COMPRESS(1)

NAME
       dh_compress - compress files and fix symlinks in package build directories

SYNOPSIS
       dh_compress [debhelperoptions] [-Xitem] [-A] [file...]

DESCRIPTION
       dh_compress is a debhelper program that is responsible for compressing the files in package build directories, and makes sure that any
       symlinks that pointed to the files before they were compressed are updated to point to the new files.

       By default, dh_compress compresses files that Debian policy mandates should be compressed, namely all files in usr/share/info,
       usr/share/man, files in usr/share/doc that are larger than 4k in size, (except the copyright file, .html and other web files, image files,
       and files that appear to be already compressed based on their extensions), and all changelog files. Plus PCF fonts underneath
       usr/share/fonts/X11/

FILES
       debian/package.compress
	   These files are deprecated.

	   If this file exists, the default files are not compressed. Instead, the file is ran as a shell script, and all filenames that the shell
	   script outputs will be compressed. The shell script will be run from inside the package build directory. Note though that using -X is a
	   much better idea in general; you should only use a debian/package.compress file if you really need to.

OPTIONS
       -Xitem, --exclude=item
	   Exclude files that contain item anywhere in their filename from being compressed. For example, -X.tiff will exclude TIFF files from
	   compression.  You may use this option multiple times to build up a list of things to exclude.

       -A, --all
	   Compress all files specified by command line parameters in ALL packages acted on.

       file ...
	   Add these files to the list of files to compress.

CONFORMS TO
       Debian policy, version 3.0

SEE ALSO
       debhelper(7)

       This program is a part of debhelper.

AUTHOR
       Joey Hess <joeyh@debian.org>

11.1.6ubuntu2							    2018-05-10							    DH_COMPRESS(1)
All times are GMT -4. The time now is 02:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy