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 142341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:55:16+00:00 2026-05-11T07:55:16+00:00

1st of all: I’m not programmer, neither Linux guru, just have to work with

  • 0

1st of all: I’m not programmer, neither Linux guru, just have to work with Linux, Oracle, shell scripts.

My current task is to monitor a table in Oracle (tool: sqlplus), and if it contains a certain row, then watch a linux directory for a growing tmp file, and log its attributes (e.g. ls -l), in every 5 second.

The most important part is: this tmp file will be deleted if the above record is deleted from the oracle table, and I need the last contents of this tmp file.

I can’t control the Oracle data, just got query rights.

The available tools are: bash, awk, sed, some old version of perl, ruby (not 1.9*), and python (2.5). I don’t have install rights, so most of the outside libraries are not accessible. I know I can run some libraries from my $HOME, but I don’t have internet connection on that machine: so can’t download any library.

Inotify is not available (older kernel).

Any idea where to start/how to do it? Thanks in advance.

  • 1 1 Answer
  • 2 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. 2026-05-11T07:55:16+00:00Added an answer on May 11, 2026 at 7:55 am

    This is ugly and naive… but…

    #!/bin/bash  WASTHERE=0 MONITORING=/tmp/whatever.dat LASTBACKUP=/tmp/mybackup.dat LOGFILE=/tmp/mylog.log  # Just create an empty file to start with touch '$LASTBACKUP'  while [ 1 ]; do         if [[ ! -e '$MONITORING' ]]; then                 if [[ $WASTHERE -ne 0 ]]; then                         echo 'File is gone!  Do something with $LASTBACKUP';                         WASTHERE=0                 fi         else                 WASTHERE=1                 ls -l '$MONITORING' >> $LOGFILE                 cp '$MONITORING' '$LASTBACKUP'         fi          sleep 5 done 

    The unfortunate part about this is that if anything happens to the file being ‘monitored’ while the script is sleeping (content is written to it, for example) and the file is then deleted before the script wakes up, the newly written content will not be in the ‘backup.’

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

Sidebar

Related Questions

1st of all: I'm not a programmer, never learnt programming/algorithms. Actually I have to
I have two database tables, 1st is the TABLE_GLOBAL_PRODUCTS where all products information are
I'm writing a prism application, I've just created my 1st module, fired it all
1st disclaimers: I'm not a programmer, never was had never been taught higher math
All the scripts I have found via Google search rely on some sort of
All I have two table 1st table is : wp_frm_item_metas 2nd table is :
how can i get all the records from 1st table not present in the
I have two sets (ILists) where I need all the items from the 1st
I've searched all over and saw different variances. But neither seemed to work for
I have 2 problems. The 1st problem. I have a CheckedTextView Select All item

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.