Sponsored Content
Top Forums UNIX for Dummies Questions & Answers korn shell script to keep history of same file Post 302092440 by samsam on Monday 9th of October 2006 10:38:20 PM
Old 10-09-2006
you can try this

#!/bin/sh
mv <filename> <filename.`date +%Y%d%m%H%M%S`>
find <dirname> -type f -name <filename.*> -mtime +13 -exec ls -lt {} \; -exec rm -f {} \; >file_list





rgrds,
samsam
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Korn Shell Script - Read File & Search On Values

I am attempting to itterate through a file that has multiple lines and for each one read the entire line and use the value then to search in other files. The problem is that instead of an entire line I am getting each word in the file set as the value I am searching for. For example in File 1... (2 Replies)
Discussion started by: run_unx_novice
2 Replies

2. AIX

Help with Korn Shell script

I have this Korn shell script that runs via a cron entry. It runs in a loop "watching" a specific file system for files with a certain name. The file system that it is watching is an upload file system for an FTP server. When files that are the correct name come in, it takes the extension of the... (1 Reply)
Discussion started by: heprox
1 Replies

3. Shell Programming and Scripting

Korn Shell Script

I have to solve some exercises in Korn Shell, but i'm having some problems. For example: Write a korn shell script with an alfanumeric string as argument. The script lists the file's names in the current directory that contain the given string as substring and that can be read and written. I... (3 Replies)
Discussion started by: burm
3 Replies

4. Shell Programming and Scripting

Monitor file generation for an hour using Korn shell script

Hi, I am new to this unix scripting, I got a requirement like.. Files with *.XML extension will be generating in a /home/sample/ folder for every 15 mins. I need to monitor those files in that particular folder for every hour. If no file has been generated in that particular folder for an... (7 Replies)
Discussion started by: siri_886
7 Replies

5. Shell Programming and Scripting

Write output to a file using Korn shell script

All, Can anyone please help me with the below scenario in korn shell script. Can anyone please give me some hints to proceed on this. I have a Flat file of the below format. Input file format:... (1 Reply)
Discussion started by: sp999
1 Replies

6. Programming

create a spool file based on values passed from korn shell to sql script

this is my issue. 4 parameters are passed from korn shell to sql script. parameter_1= varchar2 datatype or no value entered my user. parameter_2= number datatype or no value entered my user. parameter_3= number datatype or no value entered my user. parameter_4= number datatype or no... (5 Replies)
Discussion started by: megha2525
5 Replies

7. Shell Programming and Scripting

Validate file count in korn shell script

Hi, I have files in the directory like below which I need to validate if all the required files are present. A_B_001 of 002_time1.txt A_B_002 of 002_time1.txt A_B_001 of 001_time2.txt Scenarios- a)If file with 001 of 002_time1 or 002 of 002_time1 is missing in the folder,script should... (6 Replies)
Discussion started by: aneeta13
6 Replies

8. Shell Programming and Scripting

Help with korn shell script to get the latest file versions in a directory

I want to write a korn shell script to get the latest three versions for a file in the directory having lot of files with various versions (files with prefix as same but time stamp as suffix) and compress it and at the same time have to remove the remaining versions of the file (other than latest... (4 Replies)
Discussion started by: maheshbabu
4 Replies

9. Shell Programming and Scripting

On korn shell, how to share history between regular user and root?

I'm exploring OpenBSD and want to stick to its default shell, which is ksh. My goal is for my regular user ("bruno") and root user to have a shared history file. However, it seems that when running as root, ksh refuses to write to a HISTFILE that is owned by non-root user. This illustrates the... (3 Replies)
Discussion started by: DevuanFan
3 Replies

10. Shell Programming and Scripting

Help Needed with File Checker Korn Shell Script

I am attempting to write a korn shell script that does the following, but I am getting errors. I'm new to korn shell scripting and am not sure what I am doing wrong. Please help with example scripts. Thanks. 1) check for day of the week 2) if day of the week is Monday then check for the... (4 Replies)
Discussion started by: ijmoore
4 Replies
tapset::kprocess(3stap) 												   tapset::kprocess(3stap)

NAME
tapset::kprocess - systemtap kprocess tapset DESCRIPTION
This family of probe points is used to probe process-related activities. kprocess.create Fires whenever a new process or thread is successfully created See probe::kprocess.create(3stap) for details. kprocess.start Starting new process See probe::kprocess.start(3stap) for details. kprocess.exec Attempt to exec to a new program See probe::kprocess.exec(3stap) for details. kprocess.exec_complete Return from exec to a new program See probe::kprocess.exec_complete(3stap) for details. kprocess.exit Exit from process See probe::kprocess.exit(3stap) for details. kprocess.release Process released See probe::kprocess.release(3stap) for details. SEE ALSO
probe::kprocess.create(3stap), probe::kprocess.start(3stap), probe::kprocess.exec(3stap), probe::kprocess.exec_complete(3stap), probe::kprocess.exit(3stap), probe::kprocess.release(3stap), stap(1), stapprobes(3stap) IBM
--- tapset::kprocess(3stap)
All times are GMT -4. The time now is 10:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy