0

I am very new to Shell Scripting. I have a directory, say "Input". Once in a while, a file(let's say test.csv) comes to this directory(Using SFTP).

I want to execute another command based on the file availability.

For example, whenever the "Input" directory contains the test.csv file, a curl command needs to be executed and the file will be moved to a archive directory. The process should be always running in production.

Thanks in advance.

Regards, Jee

codeforester
  • 39,467
  • 16
  • 112
  • 140
Kavitha
  • 185
  • 1
  • 4
  • 14
  • Please show your effort. Please take a look at this post: http://stackoverflow.com/questions/638975/how-do-i-tell-if-a-regular-file-does-not-exist-in-bash – codeforester Apr 21 '17 at 02:31
  • Hi Codeforester, Thanks for your reply. I know how to check a file exists or not. But, how to make the script to run forever? Do we need to schedule the script(using crontab) or is there any other way? – Kavitha Apr 21 '17 at 16:04

0 Answers0