You are on page 1of 4

#!/bin/csh -fb #----------------------------------------------------------# SOX Unix Change Report Script # #Script : SOX_Unix_Change.csh #Author : ratee!

Shar"a #CSR # : #$%&'() #*ate : +)/+,/,++( #*escription: #his script is create- as a part of SOX # co"p.iance. #he script /i.. search the # pro-uction ho"e -irector0 /ho"e/"spro# an- fin- out ob1ects /hich ha2e been # "o-ifie- /ithin the specifie- nu"ber of # -a0s3 passe- as a para"eter to script. # #he script /i.. then for"at the resu.t # into a co""a -e.i"ite-3.cs23 fi.e an# sen- it 2ia "ai. to the inten-e- receipients. #Usage : SOX_Unix_Change.csh ' #Argu"ents : $.*a0s: Re4uire# Specifies the nu"ber of -a0s for /hich the # script /i.. search for changes on ser2er. # 5.g. in the abo2e exa"p.e /here ' is passe-3 # the script /i.. search for changes -one in # the .ast ' -a0s fro" the ti"e the script is # run. #Scripts : $. SOX_Report_6ai..csh: #his script /i.. sen#ca..ethe "ai. to its inten-e- receipients. # ,. Con2ert_6onth.csh: #his script con2erts the # "onth fro" 76""7 for"at to nu"eric "" for"at #a--e: a--ress_.ist_SOX )%,%+$ #set the en2iron"ent source 89ho"e8/.cshrc set /or!_-ir : 89ho"e87/Unix_Change_Report7 set .og_fi.e : 89/or!_-ir87/SOX_Unix_Change..og7 #set out_fi.e : 89/or!_-ir87/Unix_Change_Report.cs27 set out_fi.e : 89/or!_-ir88/Unix_Change_Report_;-ate <=>-="-=-;.cs28 set te"p_fi.e : 89/or!_-ir87/Unix_Change_Report..st7 set a--r_fi.e : 89/or!_-ir87/a--ress_.ist_SOX7 set "ai._bo-0 : 89/or!_-ir87/bo-07 if ?-e 89.og_fi.e8@ then r" 9.og_fi.e en-if echo 7SOX_Unix_Change.csh Starting...A7;-ate;7B7 C 9.og_fi.e

#chec! to see if the argu"ent is passe- to script if ?89#arg28 :: +@ then echo 75rror: Do argu"ent is supp.ie-...7 CC 9.og_fi.e echo 7Usage: SOX_Unix_Change.csh A*a0sB7 CC 9.og_fi.e echo 7A*a0sB is nu"eric an- te..s the nu"ber of -a0s for /hich search is perfor"e-7 CC 9.og_fi.e echo 75xiting....7 CC 9.og_fi.e exit $ en-if #Run the fin- co""an- to search the ho"e -irector0 fin- 9ho"e E? -na"e 8F.csh8 -o -na"e 8F.sh8 -o -na"e 8F.s4.8 -o -na"e 8F.ct.8 -o -na"e 8F.p.8 -o -na"e 8F.ear8 E@ -"ti"e -89$8 -.s G a/! 7H printf?8=s3=-3=s3=sEn839'39%39$+39$$@I7 C 9/or!_-ir/fi.e.ist..st if !?-e 89/or!_-ir8/fi.e.ist..st@ then echo 85rror: fi.e 9/or!_-ir/fi.e.ist..st not create-8 CC 9.og_fi.e echo 75xiting7 CC 9.og_fi.e exit $ en-if #for"at the te"p fi.e in the -esire- for"at set c0 : ;-ate G a/! 7H printf?8=-839(@I7; set c" : ;-ate G a/! 7H printf?8=s839,@I7; #Con2ert -ate fro" 76""7 for"at to "" for"at 9/or!_-ir/Con2ert_6onth.csh 9c" set c"nu" : 9status #Chec! if an0 fi.es ha2e been se.ecteset reccnt : ;/c -. 9/or!_-ir/fi.e.ist..st G a/! 7H printf?8=-839$@I7; if ?89reccnt8 C +@ then echo 8Do. of ob1ects create-/"o-ifie-: 9reccnt8 CC 9.og_fi.e foreach .ine ?;cat 9/or!_-ir/fi.e.ist..st;@ set f"on : ;echo 9.ine G cut -f$ --737; set f-a0 : ;echo 9.ine G cut -f, --737; set f0rt : ;echo 9.ine G cut -fJ --737; set fna"e : ;echo 9.ine G cut -f& --737; #Con2ert -ate fro" 76""7 for"at to "" for"at 9/or!_-ir/Con2ert_6onth.csh 9f"on set f"nu" : 9status set 0ear : 9c0 if ?;echo 9f0rt G cut -cJ; :: 7:7@ then if ?89f"nu"8 C 89c"nu"8@ then K 0ear : 90ear - $ en-if echo 89fna"e390ear-9f"on-9f-a0 9f0rt8 CC 9te"p_fi.e e.se echo 89fna"e39f0rt-9f"on-9f-a08 CC 9te"p_fi.e en-if en-

# ut the hea-ing in the output fi.e echo 7Li.e Da"e3*ate 6o-ifie-7 C 9out_fi.e #Sort the te"p fi.e to create the output fi.e cat 9te"p_fi.e G sort -t 737 -! ,.$3,.&n -! ,.(3,.'6 -! ,.$+3,.$$n -! ,.$,3,.$M- CC 9out_fi.e #Create the bo-0 text fi.e echo 7 .ease fin- the attache- .ist of ob1ects create-/change-7 C 9"ai._bo-0 echo 8on the ro-uction Ser2er in the .ast 9$ -a0s.8 CC 9"ai._bo-0 echo 77 CC 9"ai._bo-0 echo 7Lor an0 issues/concerns/c.arifications sen- a "ai. to:7 CC 9"ai._bo-0 echo 7USA.6etere-.Supp.ies. ro-.SupportKxerox.co"7 CC 9"ai._bo-0 echo 77 CC 9"ai._bo-0 echo 7#han!s7 CC 9"ai._bo-0 #Sen- the fi.e as an attach"ent /ith "ai. 9/or!_-ir/SOX_Report_6ai..csh 89a--r_fi.e8 89"ai._bo-08 89out_fi.e8 if ?89status8 :: + @ then echo 76ai. /ith report sent7 CC 9.og_fi.e e.se echo 75rror: 6ai. /ith report not sent7 CC 9.og_fi.e en-if e.se echo 8Do changes to ob1ects foun- in .ast 9$ -a0s8 CC 9.og_fi.e #Create the bo-0 text fi.e echo 7Do ob1ects /ere create- or change- on the ro-uction Ser2er ?7;una"e -n;7@7 C 9"ai._bo-0 #echo 7Do ob1ects /ere create- or change- on the ro-uction Ser2er ? ongo@7 C 9"ai._bo-0 echo 8in the .ast 9$ -a0s8 CC 9"ai._bo-0 echo 77 CC 9"ai._bo-0 echo 7Lor an0 issues/concerns/c.arifications sen- a "ai. to:7 CC 9"ai._bo-0 echo 7USA.6etere-.Supp.ies. ro-.SupportKxerox.co"7 CC 9"ai._bo-0 echo 77 CC 9"ai._bo-0 echo 7#han!s7 CC 9"ai._bo-0 #Sen- the "ai. /ith no attach"ent 9/or!_-ir/SOX_Report_6ai..csh 89a--r_fi.e8 89"ai._bo-08 if ?89status8 :: +@ then echo 76ai. sent.7 CC 9.og_fi.e e.se echo 75rror: 6ai. not sent7 CC 9.og_fi.e en-if en-if #processing o2er. -oing c.eanup if ?-e 89/or!_-ir8/fi.e.ist..st@ then r" 89/or!_-ir8/fi.e.ist..st en-if if ?-e 89te"p_fi.e8@ then r" 9te"p_fi.e en-if echo 7SOX_Unix_Change.csh 5n-e- A7;-ate;7B7 CC 9.og_fi.e

exit +

You might also like