SunQuest
           Linux Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsLinux Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today!
  #1  
Old September 30th, 2002, 10:51 AM
equijada equijada is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Location: Dominican Republic
Posts: 22 equijada User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to equijada
Question Run a file when modifier the folder?

Hi All!!!
I am trying to do a replication systems using ftp . I send all text files to my serve running suse 7.3 to directory.
I wanna know if when I send a file to specify directory can I run a script in Perl to load the data to my database running in mysql?
In another word, I want a process running all the time and when come a file this script process the file and then delete the file.
I am the root and this is for local network.
Can I do this?
I am a newbie using Linux OS.
TIA

Reply With Quote
  #2  
Old October 3rd, 2002, 12:46 PM
alexgreg's Avatar
alexgreg alexgreg is offline
Full Access
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jun 2000
Location: London, UK
Posts: 2,019 alexgreg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 sec
Reputation Power: 11
Write a Perl script and run it on the cron every minute. Tell it that when it sees a new file (it will need to keep a list of files it's processed already), to dump it into the database then delete it. It won't happen immediately (the dumping) when you copy up the file, but it will happen within the minute.
__________________
Alex
(http://www.alex-greg.com)

Reply With Quote
  #3  
Old October 3rd, 2002, 02:34 PM
Ctb's Avatar
Ctb Ctb is offline
An Ominous Coward
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: Jan 2002
Posts: 4,425 Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 3 Weeks 10 h
Reputation Power: 0
Boy, I had a case of deja vu when I saw this thread... oh.. here's why.. I already answered it:

http://forums.devshed.com/showthrea...&threadid=44563

Did you think the solution was going to change if you asked the same question in a different forum? The only difference is that alex suggests once a minute and said hour. Please don't cross-post the same question unless it's appropriate to do so (which it RARELY is).

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsLinux Help > Run a file when modifier the folder?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway