10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
Could someone help me that what the problem is in this code?
#!/bin/sh
FOLDER=/abc/datasource/checkstatus
TIMESTAMP=$(date +%s)
for filename in $(find $FOLDER -maxdepth 1 -type f -name "CHECK_STATUS*"); do
f1=$($filename -Eo "{4}+")
f2=$(date -d "$f1" +%s)
if... (11 Replies)
Discussion started by: Home
11 Replies
2. Shell Programming and Scripting
I thought that this would work for grep'ing files older than 1 day.
ps -o etime,pid,user,args -e|awk '/^+-/'|sort -t- -n -k 1,1 |grep qdaemon |grep /usr/bin/ksh
But, it is not grep'ing any of files (i.e. below) older than 1 day.
d_prod 33757970 61999560 0 Oct 27 - 0:00... (8 Replies)
Discussion started by: Daniel Gate
8 Replies
3. Shell Programming and Scripting
// AIX 6.1
I need to extract PIDs of
ps -ef |grep /usr/lib/lpd/pio | awk '{print $2}'
ps -ef |grep qdaemon |grep /usr/bin/ksh | awk '{print $2}'
that are older than 1 day.
I know find . -type f -mtime +1, but it doesn't work for PIDs.
Please let me know how to get the PIDs older than... (1 Reply)
Discussion started by: Daniel Gate
1 Replies
4. Shell Programming and Scripting
Need to write a shell script on AIX box which will connect to different servers using SFTP and get the file count of only 1 day older files. (purging list)
How to achieve this?
On local server we can use:
find <path> -type f -mtime +1
But how to do it in case of SFTP? Please advise. Thanks... (9 Replies)
Discussion started by: vegasluxor
9 Replies
5. Shell Programming and Scripting
I need to archive the older than 30 day file to another uinx server.I have wrote the below uinx script.
for LOOK_DIR in /TempFiles
do
for FILE in `find ${LOOK_DIR} -mtime -30 -exec ls {} \;`
do
echo ${FILE} >> file_list ## This file will have the list of files copied and... (12 Replies)
Discussion started by: murari83.ds
12 Replies
6. HP-UX
Hello; trying to find processes older than n days, mostly user shells Tried the following code on 11.31 box: in this case older than 5 days
UNIX95= ps -ef -o user,pid,ppid,cpu,etime,stime | grep "-" | awk '{print $2}' | xargs ps -ef|grep -v '?' |\
awk '$5 !~ ""' | awk '($5 ~ "$(date "+%b")")... (6 Replies)
Discussion started by: delphys
6 Replies
7. UNIX for Dummies Questions & Answers
hi!
i wrote this script(ubuntu os):
clear
echo "number of running processes"
ps -ef | wc -lbut i can't get the number of my currently running processes...
is there a way to see HOW MANY processes are running to my system?
---------- Post updated at 11:20 PM ---------- Previous update... (2 Replies)
Discussion started by: strawhatluffy
2 Replies
8. Shell Programming and Scripting
Hi, I need a .ksh script that lists all the process that are currently running and older than 3 days. once the process list is available i need to mail the list and then kill those processes.
Quick response is highly appreciated :b:
Thanks in Advance!!!
Sri (3 Replies)
Discussion started by: Sriranga
3 Replies
9. UNIX for Dummies Questions & Answers
need help with this ...
Find files older than 5 days and remove tem after listing
list "test" file older than 5 days and then remove them (1 Reply)
Discussion started by: ypatel6871
1 Replies
10. Shell Programming and Scripting
A script or command to list files older than 2 months in a specified directory and remove it. (3 Replies)
Discussion started by: pbekal
3 Replies