Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Sh to Batch convertion

Avatar of Ramakanta Sahoo
Ramakanta SahooFlag for United States of America asked on
Windows BatchShell ScriptingVB Script
14 Comments1 Solution714 ViewsLast Modified:
Can somebody change the below unix script to windows batch file.
I dont want to use any thirdparty tools like forfiles etc for date.
if [ $# -ne 1 ]; then
  echo "Usage: $0 <oracle_admin_directory>"
  echo "Cleans .aud, .trc, core_dump files. Also backs up alert.log files"
  exit 1


find $adminDir -name *.aud -type f -mtime +15 -exec rm {} \;
find $adminDir -name *.trc -type f -mtime +15 -exec rm {} \;
find $adminDir -name alert*.backup -type f -mtime +15 -exec rm {} \;
find $adminDir -name core* -type d -mtime +10 -exec rm -rf {} \;
cd $adminDir/bdump
alertLog=`ls alert*log`
backupDate=`date +%d%m%y`
echo ${alertLog}.${backupDate}.backup
mv $alertLog ${alertLog}.${backupDate}.backup
Avatar of TakedaT
TakedaTFlag of United States of America image

Our community of experts have been thoroughly vetted for their expertise and industry experience.

This problem has been solved!
Unlock 1 Answer and 14 Comments.
See Answers