10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
As one of our requirement was to connect to remote Linux server through SFTP connection and delete some files which are older than 7 days.
I used the below piece of code for that,
SFTP_CONNECTION=`sftp user_id@host ...
cd DESIRED_DIR;
find /path/to/files* -mtime +5 -exec rm -rf {} \;
bye... (2 Replies)
Discussion started by: ATWC
2 Replies
2. Shell Programming and Scripting
As one of our requirement was to connect to remote Linux server through SFTP connection and delete some files which are older than 7 days.
I used the below piece of code for that,
SFTP_CONNECTION=`sftp user_id@host ...
cd DESIRED_DIR;
find /path/to/files* -mtime +5 -exec rm -rf {} \;... (1 Reply)
Discussion started by: ATWC
1 Replies
3. Shell Programming and Scripting
Dear Ladies & Gents,
I have a requirement to delete all the log files in /var/log/test directory that are older than 10 days and their first line begin with "MSH" or "<?xml" or "FHS". I've put together the following BASH script, but it's erroring out:
for filename in $(find /var/log/test... (2 Replies)
Discussion started by: Hiroshi
2 Replies
4. 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
5. 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
6. 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
7. Shell Programming and Scripting
Hi Gurus
the count of files in a particular Directory...
ls -lrth | grep -c ^-
can any one share the command to Count the files which is Older than 3 months
So please help me out in this
Thanks in Advance (2 Replies)
Discussion started by: SeenuGuddu
2 Replies
8. Shell Programming and Scripting
Hello All,
I need to write a script/command which can find out the number of .csv files residing in a directory older than 1 day. The output should come with
datewise (means for each date how many files are there).
I've this command, but this command gives the total number of files. It's... (10 Replies)
Discussion started by: NARESH1302
10 Replies
9. Shell Programming and Scripting
Hi
When trying to find and delete files which are, say, 1 day, the find command misses a day. Please refer the following example.
xxxd$ find . -type f -ctime +1 -exec ls -ltr {} \;
total 64
-rw-rw-r-- 1 oracle xxxd 81 Apr 30 11:25 ./ful_cfg_tmp_20080429_7.dat
-rw-rw-r-- 1... (4 Replies)
Discussion started by: guruparan18
4 Replies
10. Shell Programming and Scripting
Hi all,
I wrote this script to find files older than time parameter, count the number of files, and send an email to me that some files are in a particular folder. For the particular path, the script should wait delay parameter before running again.
For example, assuming the input file looks... (4 Replies)
Discussion started by: kayarsenal
4 Replies