Automation, Copy, File Status Check --> Script(s)


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Automation, Copy, File Status Check --> Script(s)
# 1  
Old 09-03-2012
Automation, Copy, File Status Check --> Script(s)

All,

I have to write a script to do the following requirement.
There is a file called BUSINESS_DATE.TXT.
This file get updated once the oracle partition created. In Oracle, Partition will be created every day. There is a seperate script scheduled to take care ORACLE partition creation.
The above file will have only one row. i.e
03092012
If Oracle partition creation job failed, the above file won't be updated.
My requirement is,
I have to check whether the BUSINESS_DATE file is updated today or not. If yes, I will have to move the files from common area to input file directory to process those files.
All file name will amend with current date.
i.e
LIDDIFD03092012.TXT
The key part is to check the BUSINESS_DATE.TXT file is updated properly or not.
We don't know what time the file will get updated. So we are planning to schedule the new script to run for every 15 mins to check whether the file is updated or not.
is the above proposal is ok or is there any other feasible solution to do the same?
# 2  
Old 09-03-2012
I think BUSINESS_DATE.TXT file having only one line that is date.

Means you can check for today's date..

Code:
$ date +%d%m%Y
03092012

Check if the file contains today's date or not after every 15 min.
# 3  
Old 09-03-2012
any more inputs?

---------- Post updated at 10:36 AM ---------- Previous update was at 10:19 AM ----------

is it possible to create instance for a single script? My requirment is i need to run the same script for different countries. say for example, I have a input parameter called "CountryCode". If i pass, INDIA, The script needs to create an instance and should run. Parallely if i pass 'UK', the same script should create an instance for UK and should run. is it possible to create multiple instance for a shell script?
# 4  
Old 09-04-2012
Yes. It is possible to create multiple instances of a single script but you have run it in background . Just give the input and run the script in background for your specific country code.

Something like this...

Code:
$sh Your_script.sh "India" &

$sh Your_script.sh "US" &

One small demo example ..
I have created one script which reads the input and print's it to the one file..
And got the desired output of all the three scripts..
Hope it helps..Smilie

Code:
$ cat file3.sh
a=$1
for (( i="$a";i>0;i--))
do
echo "$i" >> file_test
echo "$a" >> file_test
done

$sh file3.sh 11 &
sh file3.sh 8 &
sh file3.sh 6 &

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Automation script for email alert when a job get complete with status successful.

Guyz, Please let me know about script which is to be sending an automatic email to particular mail id's when a monotoring job get complete with status successful. (1 Reply)
Discussion started by: Rehan Ahmad
1 Replies

2. Shell Programming and Scripting

Script to check process status

Hi Team, I am using redhat 6.4 version server.We have a script which is used to check the process and sends email if the process is not running.If it is running it will continue and do some other operation. I didnot understand below option -z in the if condition.I have tried to... (5 Replies)
Discussion started by: muraliinfy04
5 Replies

3. Shell Programming and Scripting

Shell script which will check the target file and folder exists and copy it

Hi All, I am a beginner in this and trying to write a shell script in linux which will : 1. Ask for a file name and check if its exists. 2. If file exists only then it will ask for the new target folder, after entering target folder name it will check if it exists. 3. If target folder... (3 Replies)
Discussion started by: ashish_neekhra
3 Replies

4. Linux

Check up the status of a Script (running or not)

Hello, i allready search on google und here in the local Forum, but can't found something. I need a query in php, that check whether a process (script) is running or not. Like this: php query: /usr/bin/Script01 >> if runnig, then: "Script01 is Online", if not "Script01 is Offline" I... (2 Replies)
Discussion started by: ProTechEx
2 Replies

5. Shell Programming and Scripting

How to check the status of script for every 5 min?

Hi, Can any1 provide the code for my req: I am loading few set of files into database through one unix script. I ll try to describe the process: load_cdr-->main script Source Feeds are A & B. File in A-akm.dat File in B-bkm.dat Now my script runs through cron jobs everyday...and for both... (6 Replies)
Discussion started by: gnnsprapa
6 Replies

6. Shell Programming and Scripting

Help....script check status if see something then send email

autorep -m bogus Machine Name Max Load Current Load Factor O/S Status ___________ ________ ___________ ______ ________ ______ bogus --- --- 1.00 Sys Agent Online Status ______ Online Offline Missing Unqualified The "Status" always "Online". I like create a script execute run... (6 Replies)
Discussion started by: dotran
6 Replies

7. Shell Programming and Scripting

shell script to take input from a text file and perform check on each servers and copy files

HI all, I want to script where all the server names will be in a text file like server1 server2 server3 . and the script should take servernames from a text file and perform copy of files if the files are not present on those servers.after which it should take next servername till the end of... (0 Replies)
Discussion started by: joseph.dmello
0 Replies

8. Shell Programming and Scripting

How to track exit status of ftp automation

ftp automation code is ftp -v -n -i $host_name << EOF user $u_name $u_pass bi mput $tar_file bye EOF How to check whether the file is successfully transfered or not. Suppose the user name or password is provided wrongly then the code should track the error and ask the end user to enter... (2 Replies)
Discussion started by: Dip
2 Replies

9. Shell Programming and Scripting

Script to check status of a PID

i'm just learning scripting, and have been banging my head against this I want to check if my WAS6 java process is running and if so..echo me a messages. If not then echo me a different messages the problem i have is I dont know how to represent a NULL return value. If i grep for a was6... (14 Replies)
Discussion started by: zeekblack
14 Replies

10. UNIX for Dummies Questions & Answers

how to check exit status in awk script

Hi, I have a main program which have below lines - awk -f test.awk inputFileName - I wonder how to check status return from awk script. content of awk script: test.awk --- if ( pass validation ) { exit 1 } else { (1 Reply)
Discussion started by: epall
1 Replies
Login or Register to Ask a Question