Sponsored Content
Full Discussion: Need Script for File Watcher
Top Forums UNIX for Advanced & Expert Users Need Script for File Watcher Post 302483076 by DGPickett on Thursday 23rd of December 2010 01:35:27 PM
Old 12-23-2010
c:/? Which UNIX is this?

It sound like one cron line:
Code:
0 8 * * * scp2 +C -d user@host:path1/*file_wildcard1  user@host:path2/*file_wildcard2 . . . c:/newfolder

This has compression and picks up many files in one command. Does it need to avoid moving the same file twice somehow?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

file watcher job

Hello, I am trying to create a file watcher script to check for a file until certain time and throw a message. can some one please help me if there is script handy ?? Thanks, Sateesh (1 Reply)
Discussion started by: kotasateesh
1 Replies

2. Shell Programming and Scripting

File Watcher

Hi Please help me in this I want to execute a shell script abc.ksh. But I only want it to execute if file XYZ is not present. If file XYZ is present than I want to unix to sleep for 5 Sec and than agaian check for XYX existence. if it sleeps for more than 30 seconds ( 6 time )I want it to... (3 Replies)
Discussion started by: er_zeeshan05
3 Replies

3. Shell Programming and Scripting

File Watcher using autosys

Hi, Would like to kick off a script based on the file arrival using autosys but this has to monitor every second instead of a minute. Is there a better way to implement the monitor apart from cronjob and only need to use autosys in UNIX. Regards, Rajasilpa (0 Replies)
Discussion started by: rajasilpa
0 Replies

4. Shell Programming and Scripting

File Watcher Help !!

Hi Experts I will have be having 3 types of files in directory file1_p0_date file1_p1_date file1_p2_date As soon as it sees any of the files it needs to kick off another process and also would need the file name For this I am creating a file watcher script which will look for file1* My... (2 Replies)
Discussion started by: westernmichnov
2 Replies

5. Shell Programming and Scripting

Help needed with File Watcher script

Hi all, I am writing a script to do the following: 1) Check if there are any new <csv> files (in abc directory) to process 2) If there is new file, then perform some operation on that file. 3) Move it to a different location(after step2 is successful) 4) Do further processing on the file ... (2 Replies)
Discussion started by: stunnerz_84
2 Replies

6. UNIX for Dummies Questions & Answers

Watcher Script

Hi Guys, I hope anyone can help me on how to create a watcher-script. The script will act as watcher wherein whenever it will find an error (say the word Error) in a file, it will prompt the user. Please help! br, rymnd_12345 (3 Replies)
Discussion started by: rymnd_12345
3 Replies

7. UNIX for Dummies Questions & Answers

Autosys file watcher

Hi friends, Instead of creating a script autosys 11.3 has a feature for filewatcher. Can anyone please share a link where ican create a file watcher job (more like manual). i need to create a filewatcher job where the job should search for a file for every 5 mins and send a mail whether the... (1 Reply)
Discussion started by: robertbrown624
1 Replies

8. Shell Programming and Scripting

Looking out for the file-watcher

Hi friends, I do not have much thoughts so need any help on the below issue: I need to create shell script that will find the files & throw an error through job (autosys) when file not found. Daily we use to receive 3 files from a system. Obstacles: 1) All 3 files names are same. 2)... (4 Replies)
Discussion started by: tush
4 Replies

9. Shell Programming and Scripting

File watcher script

if test -n "$(find/data/path/ 'filename.txst' -print-quit) then echo "file found" exit 0 else echo "file not found" exit 46 fi So I basically looking to understand the if test -n "$(find/data/path/ 'filename.txst' -print-quit) line. Pls help to elaborate what this command... (6 Replies)
Discussion started by: Nsharma3006
6 Replies

10. Shell Programming and Scripting

Required help on a Generic File-watcher script

Hi All, Good morning... I have prepared a shell script which will monitor files in a certain folder and if available, SCP it to a destination path. Now the challenge I'm facing is my script is currently SCP-ing to only a single destination path. Wherever different destination path is in... (1 Reply)
Discussion started by: saps19
1 Replies
File::ChangeNotify::Watcher(3pm)			User Contributed Perl Documentation			  File::ChangeNotify::Watcher(3pm)

NAME
File::ChangeNotify::Watcher - Base class for all watchers VERSION
version 0.22 SYNOPSIS
my $watcher = File::ChangeNotify->instantiate_watcher ( directories => [ '/my/path', '/my/other' ], filter => qr/.(?:pm|conf|yml)$/, exclude => ['t', 'root', qr(/(?!.)[^/]+$)], ); if ( my @events = $watcher->new_events() ) { ... } # blocking while ( my @events = $watcher->wait_for_events() ) { ... } DESCRIPTION
A "File::ChangeNotify::Watcher" class monitors a directory for changes made to any file. You can provide a regular expression to filter out files you are not interested in. It handles the addition of new subdirectories by adding them to the watch list. Note that the actual granularity of what each watcher subclass reports may vary across subclasses. Implementations that hook into some sort of kernel event interface (Inotify, for example) have much better knowledge of exactly what changes are happening than one implemented purely in userspace code (like the Default subclass). By default, events are returned in the form File::ChangeNotify::Event objects, but this can be overridden by providing an "event_class" attribute to the constructor. The watcher can operate in a blocking/callback style, or you can simply ask it for a list of new events as needed. METHODS
File::ChangeNotify::Watcher::Subclass->new(...) This method creates a new watcher. It accepts the following arguments: o directories => $path o directories => @paths This argument is required. It can be either one or many paths which should be watched for changes. o filter => qr/.../ This is an optional regular expression that will be used to check if a file is of interest. This filter is only applied to files. By default, all files are included. o exclude => [...] An optional list of paths to exclude. This list can contain either plain strings or regular expressions. If you provide a string it should contain the complete path to be excluded. The paths can be either directories or specific files. If the exclusion matches a directory, all of its files and subdirectories are ignored. o follow_symlinks => $bool By default, symlinks are ignored. Set this to true to follow them. If this symlinks are being followed, symlinks to files and directories will be followed. Directories will be watched, and changes for directories and files reported. o sleep_interval => $number For watchers which call "sleep" to implement the "$watcher->wait_for_events()" method, this argument controls how long it sleeps for. The value is a number in seconds. The default is 2 seconds. o event_class => $class This can be used to change the class used to report events. By default, this is File::ChangeNotify::Event. $watcher->wait_for_events() This method causes the watcher to block until it sees interesting events, and then return them as a list. Some watcher subclasses may implement blocking as a sleep loop, while others may actually block. $watcher->new_events() This method returns a list of any interesting events seen since the last time the watcher checked. $watcher->sees_all_events() If this is true, the watcher will report on all events. Some watchers, like the Default subclass, are not smart enough to track things like a file being created and then immediately deleted, and can only detect changes between snapshots of the file system. Other watchers, like the Inotify subclass, see all events that happen and report on them. AUTHOR
Dave Rolsky <autarch@urth.org> COPYRIGHT AND LICENSE
This software is Copyright (c) 2012 by Dave Rolsky. This is free software, licensed under: The Artistic License 2.0 (GPL Compatible) perl v5.14.2 2012-04-14 File::ChangeNotify::Watcher(3pm)
All times are GMT -4. The time now is 10:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy