Sponsored Content
Full Discussion: how to poll for new files?
Top Forums Shell Programming and Scripting how to poll for new files? Post 302357587 by bakunin on Wednesday 30th of September 2009 08:14:23 AM
Old 09-30-2009
You don't have to do the polling in the script, just place the script in the crontab and cron will call it at regular intervals for you. (see "man cron" for details on how to do this.)

It is possible to get a list of files sorted by timestamp ("ls -rt" or "ls -t"), therefore the only thing you have to remember between runs of the script is the last file you have processed.

I hope this helps.

bakunin
 

7 More Discussions You Might Find Interesting

1. IP Networking

select vs poll

Hi, Off late I had been looking at the differences b/w select() & poll() system calls. The requirement is to reduce the overhead, processor power in waiting for the data. In the kind of connections under consideration there would be very frequent data arriving on the sockets, so poll() fares... (12 Replies)
Discussion started by: smanu
12 Replies

2. UNIX for Dummies Questions & Answers

Poll data from a file

I have to write a script where I poll a txt file for data (30 min interval) Dependent on the data read, the script should return a message. It should look something like the "code" below: -- do while <data recived> sleep 30m read data from file Done If <data> x return "A" If... (1 Reply)
Discussion started by: ioniCoder
1 Replies

3. Programming

pipe() and poll() problem in C

Hi all, Im trying to do a simple program which ask the user for a unix command with the arguments. The program fork and the two process communicate with pipes. The child process call execvp with the command and the father process read the result of the execvp via the pipe. This program works... (11 Replies)
Discussion started by: blackmamba21
11 Replies

4. Shell Programming and Scripting

How to use poll() for I/O multiplex

Hi, guys: I want to write my own shell using C. I am confused about the usage of I/O multiplex. Does anyone know some examples or explain it to me ? Thanks so much (1 Reply)
Discussion started by: tomlee
1 Replies

5. Shell Programming and Scripting

Script to Poll Directory and Copy files

Hi all, I'm looking for a script to poll a specified directory and copy new files to another location. The script should only copy new files so, I based on mtime I guess? Can anyone point me in the right direction of a script which could do this? My scripting skills aren't too bad, but... (1 Reply)
Discussion started by: JayC89
1 Replies

6. Shell Programming and Scripting

Shell Script to poll files

Hello, I need to write a script for my prod servers, here is the requirement. 1. Shell script should poll the directory everyday at 3pm for 2 files a.csv and a.dat. It should poll the directory for the files for only 15 mins after that it should error out saying that no files received.... (6 Replies)
Discussion started by: Siddheshk
6 Replies

7. AIX

Poll of sorts - on LDAP

1) Do you use LDAP on AIX? (as a client) 2) If yes, what LDAP server technology do you use: a) IDS (or ITDS) - IBM Tivoli Directory Server b) AD c) openLDAP d) other - please list. I ask, because I am looking at openLDAP as well as IDS and am wondering if there is a clear preference I... (4 Replies)
Discussion started by: MichaelFelt
4 Replies
GFS_CHMOD(3)															      GFS_CHMOD(3)

NAME
gfs_chmod - change permissions of a file SYNOPSIS
#include <gfarm/gfarm.h> char *gfs_chmod (char * gfarm_url, mode_t mode); DESCRIPTION
gfs_chmod() changes the mode of the file given by gfarm_url. Permission bit masks of mode are similar to ones of mode parameter to chmod(2), though only the least 9 bit are effective. An executable file cannot be changed to a non-executable file and vice versa, unless the number of fragment of the file is only one. In detail, a file has multiple fragments with any execution bit should not be changed to that with no execution bit. It is necessary to have at least one execution bit. Similarly, a file has multiple fragments with no execution bit should not be changed to that with any execu- tion bit. RETURN VALUES
NULL The function terminated successfully. GFARM_ERR_NO_MEMORY Insufficient memory was available. GFARM_ERR_AUTHENTICATION User authentication failed when connecting to gfmd(8) or gfsd(8). GFARM_ERR_PERMISSION_DENIED The parent directory of gfarm_url did not allow write permission. GFARM_ERR_OPERATION_NOT_PERMITTED The effective UID does not match the owner of the file, and is not zero. Or an attempt was made to change an executable file with more than one fragment to a non-executable file, or vice versa. GFARM_ERR_NO_SUCH_OBJECT The file does not exist. GFARM_ERR_NOT_A_DIRECTORY A component of the path prefix is not a directory. Others An error except the above occurred. The reason is shown by its pointed strings. Gfarm 13 November 2006 GFS_CHMOD(3)
All times are GMT -4. The time now is 02:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy