Sponsored Content
Full Discussion: Request for Recommendations
Top Forums UNIX for Advanced & Expert Users Request for Recommendations Post 302280365 by Ariean on Monday 26th of January 2009 04:14:11 PM
Old 01-26-2009
Request for Recommendations

Hello Guru's,

I created this shell script to copy over the files from one location to other location and generating a list of files to process them through ETL tool. Could you please review the code and tell me if you have any recommendations or changes for my code or any thing wrong in my code. Appreciate your time and help, Thank you!

Code:
#!/bin/sh
#set -x
uploaddir="/u01/app/informatica/dev3/sample/GPMDir/UploadDir"
processdir="/u01/app/informatica/dev3/sample/GPMDir/ProcessDir"
datetime=`date +%Y%m%d`
logdir="$processdir/GPMLogFile_$datetime.log"

echo "<---------------Start Copying & Moving GPM Files To Process Directory-------------->" > $logdir

cat /dev/null >$processdir/dummy.txt
echo "Creating A Dummy File In The Process Directory" >> $logdir

rm -rf $processdir/*.list
echo "Removed All The List Files Generated Earlier In The Process Directory" >> $logdir

cd $uploaddir
echo "Current Directory Path Is:" >> $logdir
echo "`pwd`" >> $logdir

if [ -f "$uploaddir"/"GPM_"*".csv" ];then
	cp $uploaddir/GPM_*.csv $processdir
          if [ $? -eq 0 ] ; then
          echo "Master GPM Files Were Copied Successfully Into Process Directory" >> $logdir
          else
	  echo "Error In Copying Master GPM Files Into Process Directory" >> $logdir
          fi
else 
	echo  "Master GPM Files Doesn't Exists In Upload Directory, Hence Cann't Copy Over The Files Into The Process Directory" >> $logdir
fi

if [ -f "$uploaddir"/*"_FI.csv" ]; then
		for i in `ls -rt *_FI.csv`
		do
			echo $processdir/$i>> $processdir/GPM_FI.list
			cp $uploaddir/$i $processdir
			#mv $uploaddir/$i $processdir
		done
	echo "FI Files Exists, Generated The FI File List & Copied Over The FI Files Successfully Into The Process Directory" >> $logdir
else 
	echo "FI Files Doesn't Exists,Creating Dummy File List" >> $logdir
	ls -rt $processdir/dummy.txt > $processdir/GPM_FI.list
fi

 

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Recommendations for a convert

I'm on my way, I've seen the light and it's not a train at the other end of the tunnel :) What tutorial or manual or reference point(s) would you recommend for an experienced DOS and CP/M type, who wants to learn the command equivalents within Unix? I have a good understanding of program... (2 Replies)
Discussion started by: Keith
2 Replies

2. Shell Programming and Scripting

your recommendations

Hi all, I'm trying to teach myself shell programming and scripting. What are good introduction level programming and/or scripting books that you recommend? I will gather your suggestions into a list and check out the IT-related sections of the nearest Barnes & Noble stores. Or if you could... (1 Reply)
Discussion started by: antalexi
1 Replies

3. UNIX for Dummies Questions & Answers

Looking for recommendations for free Xserver

Hello , im not sure if its the right forum... im sorry if not im working with putty allot , but now I started to work with more graphical applications and im looking for free simple and fast Xserver to remote connection, can someone recommend me if there is something like that ? (3 Replies)
Discussion started by: umen
3 Replies

4. UNIX for Advanced & Expert Users

SAP swap recommendations

Hello all. My company is installing an SAP ERP financials. The consultants are asking me to allocate 30Gbytes of swap. This is on a dedicated Linux box running Redhat 5 64Bit OS. It has 16GB of RAM.I have asked for an explanation but all I'm getting is that this is what SAP recommends. It seems... (2 Replies)
Discussion started by: jhtrice
2 Replies

5. Solaris

ZPOOL Reconfig Recommendations(?)

Current Setup: OS: Solaris 10 (5.10) x64 Motherboard: SUPERMICRO MBD-PDSME+-O LGA 775 Intel 3010 SATA Controller: SUPERMICRO AOC-SAT2-MV8 - SATA Controller (x2) Link Aggregated @ 2Gb: 110MB sustained throughput :b: NAME STATE READ WRITE CKSUM storagepool ONLINE ... (3 Replies)
Discussion started by: sol72
3 Replies

6. UNIX for Dummies Questions & Answers

Reinstall recommendations?

I'm currently running 32-bit Xubuntu 8.10 and I'm thinking of changing over to 64-bit Ubuntu 9.04. Any recommendations on how to make this go more smoothly? -----Post Update----- Can I shuffle around the partitions and install it as a second OS? Is there a good way to do that? (2 Replies)
Discussion started by: CRGreathouse
2 Replies

7. Fedora

Recommendations on Unix Distro

I'd like to become more familiar with Unix. To that end I want to install and practice/play with a (open source) Unix distro; however, I'm uncertain which one I should use. I'm considering freebsd, openbsd, and openSolaris. I'm familiar and comfortable with RHL/CentOS and Debian/Ubuntu. Keeping... (3 Replies)
Discussion started by: NateKin
3 Replies
AMTOC(8)						      System Manager's Manual							  AMTOC(8)

NAME
amtoc - generate TOC (Table Of Contents) for an Amanda run SYNOPSIS
amtoc [ -a ] [ -i ] [ -t ] [ -f file ] [ -s subs ] [ -w ] [ -- ] logfile DESCRIPTION
Amtoc generates a table of contents for an Amanda run. It's a perl script (if you don't have perl, install it first!). OPTIONS
-a The output file name will be label-of-the-tape.toc in the same directory as logfile. -i Display help about amtoc. -t Generate the output in tabular form. -f file Write the output to a file ('-' for stdout). -s subs Evaluate the output file name from subs, with $_ set to label-of-the-tape. The -a option is equivalent to -s 's/$_/.toc/'. -w Separate tapes with form-feeds and display blank lines before totals. -- Marks the last option so the next parameter is the logfile. logfile (use '-' for stdin) OUTPUT FORMAT
The standard output has five fields separated by two spaces: # Server:/partition date level size[Kb] 0 daily-05: 19991005 - - 1 cuisun15:/cuisun15/home 19991005 1 96 2 cuinfs:/export/dentiste 19991005 1 96 ... 103 cuisg11:/ 19991005 0 4139136 103 total: - - 16716288 In tabular format (-t), this would look like: # Server:/partition date lev size[Kb] 0 daily-05: 19991005 - - 1 cuisun15:/cuisun15/home 19991005 1 96 2 cuinfs:/export/dentiste 19991005 1 96 ... 103 cuisg11:/ 19991005 0 4139136 103 total: - - 16716288 USAGE
The easiest way to use it is to run amtoc right after amdump in the cron job: amdump DailySet1 ; logdir=`amgetconf DailySet1 logdir` ; log=`ls -1t $logdir/log.*.[0-9] | head -1` ; amtoc -a $log which will generate /etc/amanda/DailySet1/tape_label.toc. You may also want to call amtoc after an amflush. SEE ALSO
amanda(8), amdump(8), amflush(8), amgetconf(8), cron, perl AUTHOR
Nicolas MAYENCOURT <Nicolas.Mayencourt@cui.unige.ch> University of Geneva/Switzerland AMTOC(8)
All times are GMT -4. The time now is 02:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy