Sponsored Content
Top Forums Shell Programming and Scripting Detecting incoming files without busy polling Post 302225335 by zaxxon on Friday 15th of August 2008 07:36:49 AM
Old 08-15-2008
When transferring files with whatever protocol and you keep the original date for them, I guess you won't find a difference with "find -mtime".

Maybe a bit more reliable is to make find on all files and pass them with exec or xargs to "cksum", write it to some file and then compare it every interval you'd like.
So if there is any difference, may it be a different sum or a new sum for a file that didn't exist already or a removed one, you should notice that.

Last edited by zaxxon; 08-15-2008 at 10:37 AM.. Reason: It's cksum, not chksum
 

10 More Discussions You Might Find Interesting

1. Programming

Help - Polling Script

How do I write a shell script to perform polling just like what happens with Microsoft mail. i.e display an alert box. (1 Reply)
Discussion started by: brianmu
1 Replies

2. UNIX for Advanced & Expert Users

How to avoid polling???

Hi all, I have a directory where some process is keeping incremental/new log files. I need to code a program which will periodically poll this directory and if it founds a new file arrived then copy that new file to some other specific directory. We are OK with this polling approach. I just... (3 Replies)
Discussion started by: zing_foru
3 Replies

3. Shell Programming and Scripting

Script to number incoming files

Hey guys, I am working on a Cshell script and I am stuck on this one part. I need to be able to copy in files to my directory but give them different names so they don't overwrite each other. For example, my folder already contains FILE.1 I want my script to name the next file copied over... (5 Replies)
Discussion started by: hootdocta5
5 Replies

4. UNIX for Dummies Questions & Answers

Help: script to monitor incoming files

I have 20 or so files that are ftp'd each day to a particular directory. I want to create a script that will tell me if any of these files fails to arrive or if any additional files arrive. I'm thinking I'd have a list of file names that should arrive each day, and the script would check each days... (2 Replies)
Discussion started by: daveyc82
2 Replies

5. UNIX for Advanced & Expert Users

Filesystem mystery: disks are not busy on one machine, very busy on a similar box

Hi, We have a filesystem mystery on our hands. Given: 2 machines, A and Aa. Machine Aa is the problem machine. Machine A is running Ubuntu, kernel 2.6.22.9 #1 SMP Wed Feb 20 08:46:16 CST 2008 x86_64 GNU/Linux. Machine Aa is running RHEL5.3, kernel 2.6.18-128.el5 #1 SMP Wed Dec 17 11:41:38... (2 Replies)
Discussion started by: mschwage
2 Replies

6. Shell Programming and Scripting

Unix Polling agent

I plan to run a script which will run in background and at predefined times send mails to user . I dont have acees to autosys/ Cron / at jobs My loop works like this while (true) do getx_time=`date +%H%M` if ; then script1.sh mail_sent_flag=1 elif ; then script2.sh... (1 Reply)
Discussion started by: ultimatix
1 Replies

7. Programming

Db polling...

Hi! Im trying to make a program that polls a mysqlDB every 5 minutes. the poll checks a scheduletable in the dB and exicutes a function if there was a "go" in the scheduletable, and if it retrives a "no go" from the table it should just wait for another 5 minutes before re polling the DB, ... (1 Reply)
Discussion started by: karlblau
1 Replies

8. HP-UX

Polling target on Serviceguard

Hi Guys, we are planning to enable polling target on our SG in reference to this link MC/ServiceGuard: Subnet Goes Down when one of the Cluster Node is Down - HP Customer Care (United States - English) since our server is already in production can we apply the changes with ex. "cmapplyconf... (1 Reply)
Discussion started by: batas
1 Replies

9. Shell Programming and Scripting

Detecting new entries in log files

Hello All, I have a script that checks a log file. This will be checked periodically lets say every 5 minutes. I need to get new entries and process these new entries What do you think is the best strategy here? all i can think of currently is to backup the old file and do diff. But future... (9 Replies)
Discussion started by: ryandegreat25
9 Replies

10. Shell Programming and Scripting

Polling file

HI I need some help on this below one Have summuary file coming on daily basis with list of file names and count ,if the summuary file not exist ,pool it for every 5 mins till it arrives .Once arrived remove first and last line from the file and check all the files in respective director all... (12 Replies)
Discussion started by: mohan705
12 Replies
fam(1M) 																   fam(1M)

NAME
fam - file alteration monitor SYNOPSIS
/usr/etc/fam [ -f | -v | -d ] [ -l | -t NFS_polling_interval ] [ -T idle_timeout ] [ -p program.version ] [ -L ] [ -C ] [ -c config_file ] DESCRIPTION
fam is a server that tracks changes to the filesystem and relays these changes to interested applications. Applications such as fm(1G) and mailbox(1) present an up-to-date view of the filesystem. In the absence of fam, these applications and others like them are forced to poll the filesystem to detect changes. fam is more efficient. Applications can request fam to monitor any files or directories in any filesystem. When fam detects changes to monitored files, it noti- fies the appropriate application. The FAM API provides a programmatic interface to fam; see fam(3X). fam is informed of filesystem changes as they happen by the kernel through the imon(7M) pseudo device driver. If asked to monitor files on an NFS mounted filesystem, fam tries to use fam on the NFS server to monitor files. If fam cannot contact a remote fam, it polls the files instead. fam also polls special files. Normally, fam is started by inetd(1M). It is registered with portmap(1M) as performing the sgi_fam service. OPTIONS
-l Disable polling of NFS files. It does not disable use of remote fam on NFS servers, nor does it disable polling of local files. -t NFS_polling_interval Set the interval for polling files to NFS_polling_interval seconds. The default is six seconds. -T idle_timeout Set the idle timeout interval to idle_timeout. fam exits idle_timeout seconds after its last client disconnects. A value of 0 causes fam to wait indefinitely for new connections. The default is five seconds. -f Remain in the foreground instead of spawning a child and exiting. This option is ignored if fam is started by inetd. -v Turn on verbose messages. -d Enable verbose messages and debug messages. -p program.version Use the specified RPC program and version numbers. -L Local-only mode. fam will only accept requests from clients running on the local machine. This overrides the local_only flag in the configuration file. This option is ignored if fam is started by inetd. -C Compatibility mode. This disables authentication and reduces access security as described under SECURITY below. This overrides the insecure_compatibility flag in the configuration file. -c config_file Read configuration information from the given file rather than the default, which is /etc/fam.conf. CONFIGURATION FILE
In addition to its command-line options, fam's behavior can also be controlled through its configuration file. By default, this is /etc/fam.conf; the -c command-line option can be used to specify an alternate file. Configuration lines are in the format option=value. Lines beginning with # or ! are ignored. fam recognizes the following options: insecure_compatibility If set to true, this disables authentication and reduces access security as described under SECURITY below. This is false by default. Setting this option to true is the same as using the -C command-line option. untrusted_user This is the user name or UID of the user account which fam will use for unauthenticated clients. If a file can't be stat'ed by this user, fam will not tell unauthenticated clients about the file's existence. If an untrusted user is not given in the configuration file, fam will write an error message to the system log and terminate. local_only If set to true, fam will ignore requests from remote fams. This is false by default. Setting this option to true is the same as using the -L command-line option. This option is ignored if fam is started by inetd. xtab_verification If set to true, fam will check the list of exported filesystems when remote requests are received to verify that the requests fall on filesystems which are exported to the requesting hosts. This is true by default. If this option is set to false, fam will service remote requests without attempting to perform the verification. If the local_only configuration option or -L command-line option is used, xtab_verification has no effect. SECURITY
For backward compatibility, the -C command-line option and insecure_compatibility configuration option can be used to disable authentica- tion. Configuring fam this way opens a publically known security weakness whereby a "rogue client" can obtain the names of all the files and directories on the system. Note that fam never opens the files it's monitoring, and cannot be used by a rogue client to read the contents of any file on the system. fam only gives out the names of monitored files, and only monitors files which the client can stat(1M). Users can stat a file without hav- ing read permission on it as long as they have search permission on the directory containing it. FILES
/etc/fam.conf SEE ALSO
inetd(1M), portmap(1M), fam(3X), imon(7M), stat(1M). Silicon Graphics 0a
All times are GMT -4. The time now is 09:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy