Sponsored Content
Top Forums Shell Programming and Scripting Help with Shell Script automation Post 302381928 by jim mcnamara on Monday 21st of December 2009 12:01:15 PM
Old 12-21-2009
The safest thing to do is change process X, do not create a process Y.

Code:
date_current=`date +%m%d%y`
java -Xms512m -Xmx512m com.mainloader.databaseLoader S 12 F > file.log.$date1 fname="file.log.$date1"
mv $fname /path/to/new/${fname}

Otherwise you are stuck with a kludge-y kind of thing where you call lsof or fuser repeatedly until you see that the logfile is no long open. See the man page on your system

example:
Code:
lsof /path/to/file.log.$date1
while [[ $? -ne 0 ]]
do
       sleep 10
       lsof /path/to/file.log.$date1
done

This does a lot of pointless polling. If your system has inotify (Linux/GNU derivative) you can call inotify to see when a file is closed. Same polling problem though.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script automation using case statement

Hi, I'm trying to write a shell script that has a menu and then dependant on the selection, will automate some samba file transfer. The problem is when I run the code without the case statement it runs fine. but when I put the case statement in the only way I can get the code to run is to... (6 Replies)
Discussion started by: ianf
6 Replies

2. Shell Programming and Scripting

FTP automation script

Hi, I have got a requirement like this. a parameterized function custFtp which will take 5 i/ps and will do the following tasks. p1) server name p2) username p3) password p4) path name of the server where the file resides p5) file name pattern the function will work like this. ... (1 Reply)
Discussion started by: ani_datta
1 Replies

3. Shell Programming and Scripting

korn shell automation problem!

I got the task writting Korn Shell script to automate the tuxedo login so that users neednot have to enter options manually. I have done that using expect tool from the Unix but my manger told me its not secure so you have to do that using Kornshell without using Expect. Here is the way to login to... (0 Replies)
Discussion started by: pareshan
0 Replies

4. Shell Programming and Scripting

Automation shell scripting

Hi All, Consider my script is getting input from user under utc/stb path. I should automate the script by reading inputs from .txt file. Whenever script is prompting for input, it should read from input file. Now, i have to create a script in different path that should run my old script by... (4 Replies)
Discussion started by: poons
4 Replies

5. Shell Programming and Scripting

Help with Truststore automation shell script

Please close this thread. I have raise this question in appropriate thread. Thanks (0 Replies)
Discussion started by: KuldeepSinghTCS
0 Replies

6. Shell Programming and Scripting

shell script help needed to manage FTP automation

Hi, I am very new in shell scripting. Have managed to prepare a script which will work to download data to local directory. But facing below problem. :wall: Please help me out. Thanks in advance. Problem: 1. I am unable to use delete command to delete data in the ftp location (I have... (2 Replies)
Discussion started by: ImranBD
2 Replies

7. Shell Programming and Scripting

Script Automation

Hi Gurus, I have a clearcase script that i use to check in a single file at time on my clearcase server. the script is as follows setmyview settask 75098_MSI_TRILOGY_EIM cd /vobs/Trilogy_R12/custom/msieim/12.0.0/sql/ cleartool co -nc . ct mkelem -nc Filename_1.sql cp... (3 Replies)
Discussion started by: r_t_1601
3 Replies

8. Shell Programming and Scripting

Automation script

Hello All , I came across a tricky solution to devolop . Here is a part of the requirement automation . I have different set of server say : Web ( has 4 servers under it ) , App ( has 4 servers under it ) , DB ( has 2 servers under it ) Above each i have different load balancers , Say : Web... (4 Replies)
Discussion started by: radha254
4 Replies

9. Shell Programming and Scripting

Automation Script for Oracle

Hi, As a Oracle Developer, I am writing many Procedures,Functions and Packages. Facing Many optimization issue after writing these Database objects. Trying to tune it manually. Can we write any Shell/Perl/Python script to Optimize these Database objects instead of doing manual check and... (1 Reply)
Discussion started by: vasuvv
1 Replies

10. Shell Programming and Scripting

Shell script automation using cron which query's MySQL Tables

What I have: I have a input.sh (script which basically connect to mysql-db and query's multiple tables to write back the output to output1.out file in a directory) note: I need to pass an integer (unique_id = anything b/w 1- 1000) next to the script everytime I run the script which generates... (3 Replies)
Discussion started by: kkpand
3 Replies
INOTIFY_RM_WATCH(2)					     Linux Programmer's Manual					       INOTIFY_RM_WATCH(2)

NAME
inotify_rm_watch - remove an existing watch from an inotify instance SYNOPSIS
#include <sys/inotify.h> int inotify_rm_watch(int fd, int wd); DESCRIPTION
inotify_rm_watch() removes the watch associated with the watch descriptor wd from the inotify instance associated with the file descriptor fd. Removing a watch causes an IN_IGNORED event to be generated for this watch descriptor. (See inotify(7).) RETURN VALUE
On success, inotify_rm_watch() returns zero. On error, -1 is returned and errno is set to indicate the cause of the error. ERRORS
EBADF fd is not a valid file descriptor. EINVAL The watch descriptor wd is not valid; or fd is not an inotify file descriptor. VERSIONS
Inotify was merged into the 2.6.13 Linux kernel. CONFORMING TO
This system call is Linux-specific. SEE ALSO
inotify_add_watch(2), inotify_init(2), inotify(7) COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/. Linux 2017-09-15 INOTIFY_RM_WATCH(2)
All times are GMT -4. The time now is 05:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy