Advertisement

05.01.2007 at 06:18AM PDT, ID: 22544770
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

Shell script help for file move

Asked by markgeer in Bourne-Again Shell (bash), Linux

Tags: , , ,

I need some help with an interface on a Linux machine (RedHat AS4) but I am no expert in the Bash shell.  If this was Windows, I would have no problem writng the batch file to do the job.

Here's the situtation:  We have a purchased Windows application that creates *.xml interface files and copies them to a directory on a Network Appliance filer on our network that our Linux/Oracle server can monitor (via an nfs mount).  When new files are available there, I need Linux to move them locally, then tell Oracle to process them.  This will typically be a dozen or maybe a couple dozen files per day, ranging in size from just a few KB to about 10MB each.  There may be just one file at a time, or there could be multiple files.

I think I need a cron job to run at frequent intervals (maybe every 2 - 5 minutes) to do these steps:
1. look for files like "CARSEQ_XML[xxx][yyyy].xml" in /source_dir
2. if found, make sure it is not still being written to (wait a few seconds and try again if locked)
3. if complete, move it locally, and tell Oracle to process it

I know how to set up a cron job and I know how to write the last part: "move it locally, and tell Oracle to process it".  I need help with the other parts.

When I tested yesterday by manually copying a large (500MB) file from WIndows, then trying an "mv" command in Linux on that same file, it gave me "permission denied" while it was still being written to, but as soon as the copy was complete, the "mv" succeeded.  I don't know though in a Bash shell script how to test for success or failure of an "mv" command.  Or, is there a better way?Start Free Trial
[+][-]05.01.2007 at 06:24AM PDT, ID: 19007869

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.01.2007 at 08:20AM PDT, ID: 19009004

View this solution now by starting your 14-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Bourne-Again Shell (bash), Linux
Tags: script, shell, move, file
Sign Up Now!
Solution Provided By: DocGyver
Participating Experts: 2
Solution Grade: A
 
 
[+][-]05.01.2007 at 08:59AM PDT, ID: 19009387

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 14-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]05.01.2007 at 10:19AM PDT, ID: 19010000

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-43