Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 11-16-2010, 02:12 PM   #1
Registered: Aug 2010
Posts: 41

Rep: Reputation: 0
Check folder for specific files than move script

I have a script that checks a folder for zip files than moves them to a different folder. I want to check every 5 maybe 10 seconds and since cron is setup to run at least a 1 minute increment I'm not sure how to do that time check as probably a loop within the script.

One other thing is once the time check is in the script how would a cron job be setup to run this script? Once the script is running cron doesn't need to run it again, is there a feature to check if it's running and if it's not then run it?

find /export/xxxshare -name "*.zip" -exec mv {} /export/store \;
Old 11-16-2010, 03:19 PM   #2
Registered: Jan 2010
Location: Melbourne, IA, USA
Distribution: Ubuntu
Posts: 93

Rep: Reputation: 8
This sounds like a job for incrontab rather than crontab, I use incrontab for lots of things and it works great.

Old 11-16-2010, 09:36 PM   #3
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Two more good inotify/incron introductions here and here.
Old 11-23-2010, 05:59 AM   #4
Registered: Aug 2010
Posts: 41

Original Poster
Rep: Reputation: 0
Decided running a cronjob every minute would be sufficient.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to check that my script can check if it has a specific range of charcters. shirlcurl20 Linux - Newbie 2 11-16-2010 11:15 PM
how to check folder if it has files in it using Bash Shell script vincent.dang Linux - Newbie 7 08-05-2010 07:58 PM
[SOLVED] I need a script that will move all 30 days old files in a folder ericczed Linux - Newbie 3 01-23-2010 08:31 AM
[SOLVED] Bash script needed to move files to another folder. No_one_knows_me Linux - General 28 01-07-2010 10:29 PM
making a script that will move a file or files in a trash folder Paxmaster Programming 5 12-12-2004 06:00 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:47 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration