Continously checking folder and executing files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Continously checking folder and executing files
# 1  
Old 12-17-2008
Continously checking folder and executing files

Hello All,

I want to make a script which continously checks one folder all the time that is there is any file in it or not, and if it found any file in it than execute that file with the following command.

apxrcv -text < filename > outputfile

Actually my requirement is that i will put differnet files through ftp in this folder and i want those files to execute as soon as they come to my folder with the above command.

Regards,
Waqas Ahmed

Last edited by wakhan; 12-17-2008 at 04:10 AM..
# 2  
Old 12-17-2008
You may want to ask cron for help on this Smilie
# 3  
Old 12-17-2008
Hi.

If you are using GNU/Linux, you might use one of the FAM facilities, dnotify or inotify: File alteration monitor - Wikipedia, the free encyclopedia .

If not, you may need to use cron, but, in any case, telling us what OS you are using will bring the best answers ... cheers, drl
# 4  
Old 12-18-2008
Hi, i am using solaris OS, and my requirement is that every file which comes to my folder through FTP automatically executes with the command mentioned below. otherwise i have to manually run that command on the files.
so i want to automate this operation.
# 5  
Old 12-19-2008
Hello All,

I am transferring a file through FTP from one system to other and i want that as soon as the file comes on my system ,

command: apxrcv -text < filename > out

executes on it and then the file removes automatically.

Any idea how i can do this ?

Regards,
Waqas Ahmed
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Checking MD5 Hashes on a folder tree

Hi Guys, I have a backup program that creates incremental backups and generates a MD5 hash at the same time. Each server backup has its own sub folder. Each backup file has a corresponding .md5 file containing a hash and a file name like this. 3410efed13b087322de8036145230a55... (6 Replies)
Discussion started by: Pollardd
6 Replies

2. Shell Programming and Scripting

Checking of file exist in different folder

Hi All, Seeking for your assistance to compare if the file in working directory is found on the DIR2 directory and if not found move the file in DIR2. ex. WORKING_DIR=/home/dir1/ file1.txt DIR2=/home/admin/users file1.txt what i did was found_nonempty='' for file in... (4 Replies)
Discussion started by: znesotomayor
4 Replies

3. Windows & DOS: Issues & Discussions

How to play video files one after the other continously?

Hi, There are many MP4 files in a folder say 50 files . All these files are video clipping files.Instead of playing the video one by one , is it possible to play all video clipping files into single shot ? Say for example when i play one video file it gets over after sometime and to view... (5 Replies)
Discussion started by: Maddy123
5 Replies

4. UNIX for Dummies Questions & Answers

Script for checking the files in a folder

Hi , I am using the below script for checking for a file in a folder. if ; then echo 0 else echo 1 fi Is there any way we can check for files which are starting with GL*.csv.What I am trying to do is , I have to check in a folder for the GL*.csv files if there are any files they I... (6 Replies)
Discussion started by: wangkc
6 Replies

5. Shell Programming and Scripting

Checking files in folder using starting string for filename

Hi, How do i check if there are any files present in the folder with some specific starting string. For eg :- I have used this where Source_File is filename parameter. if then return 2 fi But in my case the source file name is not constant. The only constant thing is... (10 Replies)
Discussion started by: chetancrsp18
10 Replies

6. Shell Programming and Scripting

log monitoring continously and executing commands

Hi I want a script which continously searches for a work "MAX xonnections reached" in log file . As soon as it sees the message it needs to do series of steps 1) execute netstat command and redirect output to a file in /tmp 2) again continue monitoring the log file . this job should run until... (2 Replies)
Discussion started by: mskalyani9
2 Replies

7. Web Development

Checking if a folder is empty or not using PHP

Hi, I am sharing this tip with you all.The codes given below will explain /** * Checking a folder is empty or not. * @param string $folderName * $folderName should be folder name or path * @return TRUE/FALSE (If any file or folder found/Empty folder) */ function... (1 Reply)
Discussion started by: elizas
1 Replies

8. Shell Programming and Scripting

The checking of folder existance is not working...

Hi all, I have the following code: if ; then echo 'folder not exist'; else echo 'folder exist'; fi The "testing" folder is not exist in /home/batch , but thhe result is 'folder exist'. It seems that the code cannot detect that the folder "testing" not exist. ANybody know the... (1 Reply)
Discussion started by: suigion
1 Replies

9. Shell Programming and Scripting

Checking if any folder is opened or not?

Alogorithm: ============= Whenever any user open any specific directory: 1) cd /usr/lib The prompt should show an Alert message like 2) echo "You have opened this folder" How should I write shell script this one?.. It should be irrespective of users and... (11 Replies)
Discussion started by: Niroj
11 Replies

10. UNIX for Dummies Questions & Answers

checking missing files in side a folder

Dear all, Every hour i am receiving several data files to one folder for 24 hours each day.But some times some hours i do not have the files because of some problem.So i want to check the files inside the folder at the end of the day wether how many files i received in each hour like this.so i... (4 Replies)
Discussion started by: Nayanajith
4 Replies
Login or Register to Ask a Question