I have this Korn script that I wrote (with some help) that is run by cron. I basically watches a file system for a specific filename to be uploaded (via FTP), checks to make sure that the file is no longer being uploaded (by checking the files size), then runs a series of other scripts. The script is in a never ending loop that is "throttled" so that it when it is finding matching files its loop is shorter, but once it stops finding mathing files (in the monitored file system) it slow down until it finds another matching file.
Everything works great except that now I need to have the script monitor the same filesystem for two filenames. Actually they are the same filename but sometimes they are in ALL CAPS and sometimes they are not (for example I might get an upload.0002 or an UPLOAD.0002). Here is the script:
...how can I add additional filenames to the expression:
How do I perform a command to multiple files? For example, I want to look at all files in a directory and print the ones that do not contain a certain string. How do I go about doing this? (4 Replies)
Hi all,
I have mistkanely gzipped twice an entire folder and sub folders, and also renamed the files during that process.
I am trying to undo this, and I need help to create the batch to work on it.
All folders are under my images directory, I have a output.txt file that holds all the... (1 Reply)
Hello, I have a problem that I'm having quite a bit of trouble with.
I am trying to create a script that performs a specific sequence of actions for a file of a specific type.
This is an abbreviated version of my basic script:
#!/bin/sh
#coulombic calculations... (2 Replies)
I have a large CSV files (e.g. 2 million records) and am hoping to do one of two things. I have been trying to use awk and sed but am a newbie and can't figure out how to get it to work. Any help you could offer would be greatly appreciated - I'm stuck trying to remove the colon and wildcards in... (6 Replies)
I'm having a couple of issues. I'm trying to edit a nagios config and remove a host definition if a certain "host_name" is found. My thought is I would find host definition block containing the host_name I'm looking for and output the line numbers for the first and last lines. Using set, I will... (9 Replies)
HI all,
I want to script where all the server names will be in a text file like
server1
server2
server3 . and the script should take servernames from a text file and perform copy of files if the files are not present on those servers.after which it should take next servername till the end of... (0 Replies)
Hi,
I have a directory /home/datasets/ which contains a bunch (720) of subdirectories called hour_1/ hour_2/ etc..etc.. in each of these there is a single text file called (hour_1.txt in hour_1/ , hour_2.txt for hour_2/ etc..etc..) and i would like to do some text processing in them.
Each of... (20 Replies)
Hi everyone,
I got a data frame like the one below and and would like to do the following:
Ignore the first 3 rows and check in all following rows the second position. If the value is >500, subtract 100.
Example DF:
ABC 22 DE 12
BCD 223 GH 12
EFG 2104 DH ... (4 Replies)
Hi, We are having multiple .sql files generated programatically which is not containing..
create or replace -- at the start
and
/ -- at the end
We need to append those .sql files with the above 2 statements at their respective positions.
We will be really thankful to get responses... (6 Replies)
Hi,
I am new to awk/unix and am trying to put together an awk script to perform an action similar to vlookup between the two csv files.
Here are the contents of the two files:
File 1:
Date,ParentID,Number,Area,Volume,Dimensions
2014-01-01,ABC,247,83430.33,857.84,8110.76... (9 Replies)
Discussion started by: Prit Siv
9 Replies
LEARN ABOUT DEBIAN
dtk_nanosleep
DTK_NANOSLEEP(3) Draw Toolkit manual DTK_NANOSLEEP(3)NAME
dtk_nanosleep - high-resolution sleep
SYNOPSIS
#include <dtk_time.h>
int dtk_nanosleep(int abs, const struct dtk_timespec* req,
struct dtk_timespec* rem);
DESCRIPTION
The function dtk_nanosleep() allows the caller to sleep for an interval with nanosecond precision. If the argument abs is zero, the speci-
fied interval is interpretated as a relative value, otherwise an absolute value. The interval is specified by the req argument which is a
pointer to a dtk_timespec structure defined as:
struct dtk_timespec {
long sec; /* seconds */
long nsec; /* nanoseconds */
};
If interpreted as an absolute value, it represents seconds and nanoseconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC).
dtk_nanosleep() suspends the execution of the calling thread until either at least the time specified by req has elapsed, or a signal is
delivered that causes a signal handler to be called or that terminates the process.
If the call is interrupted by a signal handler, dtk_nanosleep() returns -1, and sets errno to EINTR. In addition, if rem is not NULL, and
abs is zero, it returns the remaining unslept time in rem. This value can then be used to call dtk_nanosleep() again and complete a (rela-
tive) sleep.
RETURN VALUE
On successfully sleeping for the requested interval, dtk_nanosleep() returns 0. If the call is interrupted by a signal handler or encoun-
ters an error, then it returns -1 and errno is set appropriately.
ERRORS
dtk_nanosleep() will fail if:
EINTR The sleep was interrupted by a signal handler.
EINVAL The value in the nsec field was not in the range 0 to 999999999 or sec was negative.
NOTE
This function is a wrapper to clock_nanosleep(2) if it is provided by the system. Otherwise, it implements the function by using the sleep
function with the highest precision available on the system.
SEE ALSO dtk_nanosleep(3), clock_nanosleep(2)EPFL 2011 DTK_NANOSLEEP(3)