Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6468637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T05:54:29+00:00 2026-05-25T05:54:29+00:00

Hello i have a script like this one: #!/usr/bin/bash ARSIP=/apps/bea/scripts/arsip CURDIR=/apps/bea/scripts OUTDIR=/apps/bea/scripts/out DIRLOG=/apps/bea/jboss-6.0.0/server/default/log LISTFILE=$CURDIR/tmp/file.$$

  • 0

Hello i have a script like this one:

#!/usr/bin/bash


ARSIP=/apps/bea/scripts/arsip
CURDIR=/apps/bea/scripts
OUTDIR=/apps/bea/scripts/out
DIRLOG=/apps/bea/jboss-6.0.0/server/default/log
LISTFILE=$CURDIR/tmp/file.$$
DATE=`perl -e 'use POSIX; print strftime "%Y-%m-%d", localtime time-86400;'`

JAVACMD=/apps/bea/jdk1.6.0_26/bin/sparcv9/java

HR=00

for (( c=0; c<24; c++ ))
do
    echo $DATE $HR
    $JAVACMD -jar LatencyCounter.jar LatencyCounter.xml $DATE $HR
    sleep 1
    cd $OUTDIR
        mv btw_120-180.txt btw_120-180-$DATE-$HR.txt
        mv btw_180-360.txt btw_180-360-$DATE-$HR.txt
        mv btw_60-120.txt btw_60-120-$DATE-$HR.txt
        mv failed_to_deliver.txt failed_to_deliver-$DATE-$HR.txt
        mv gt_360.txt gt_360-$DATE-$HR.txt
        mv out.log out-$DATE-$HR.log
    cd -
    let HR=10#$HR+1
        HR=$(printf %02d $HR);
done

cd $OUTDIR

tar -cf latency-$DATE.tar btw*-$DATE-*.txt gt*$DATE*.txt out-$DATE-*.log
sleep 300
gzip latency-$DATE.tar
sleep 300
/apps/bea/scripts/summaryLatency.sh
sleep 300
rm -f btw* failed* gt* out*

#mv latency-$DATE.tar.gz ../$ARSIP
cd -

It basically execute jar files in same directory as this script and then tar the result, gzip it and execute another bash file then delete all of the previous collected files. The problem is i need this script to run daily and i use crontab to do that. It still return empty tar file but if i execute it manually it works well..I also have other 4 scripts running in crontab and they work good..i still can’t figure out what is the main reason of this phenomena

thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T05:54:30+00:00Added an answer on May 25, 2026 at 5:54 am

    I’m guessing that when you execute $JAVACMD -jar LatencyCounter.jar LatencyCounter.xml $DATE $HR, you’re not in the directory containing LatencyCounter.jar. You might want to cd $CURDIR before you enter the for loop.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a script that looks like this #!/bin/bash function something() { echo hello
I have index.php like this: <script type=text/javascript src=jquery-1.4.2.js></script> <script type=text/javascript src=ajax.js></script> <a href='one.php' class='ajax'>One</a>
I have a python script called class.py with one line: class.py: print Hello World
Hello I have a very large SQL script and while trying to execute it
so i have ruby script that simply writes to a test.txt file with hello
Hello everyone Masters Of Web Delevopment :) I have a piece of PHP script
Hallo I have this script: <? require(lib2/config.inc.php); require(lib2/tpl.class.php); require(lib2/db.class.php); require(lib2/um.class.php); $tpl = new template(templates,
I'd like to have a a div show only when one button is clicked
I am trying a share a boolean between different scripts. In one script, I
I've done a million if and foreach's in scripts before, but this one I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.