i do have a total of 90 directories where in we have different sub-directories and one of the sub directory named logs
I need to go inside the logs subdirectory and check if a particular log is present or not.
for example below is the folder structure
cd
/a/b/c/d ;
/a/b/e/f.
I need to traverse through the directories to check the log.
Thanks in advance..
/Bhaskar
Hello bhaskar t,
Please go through from forum rules, following link may help you in same. We should use code tags for codes and commands which we are using in our posts.
Rules link is as follows. https://www.unix.com/misc.php?do=cfrules
Let us take a example here let's say we have directory sturcture like /tmp/a/b/c/d where we have files named chuma.test and logs.test.
So to search them from /tmp directory we can use as follows.
Output will be as follows.
Hope this helps, also go through from man find page it will be helpful for you.
Thanks,
R. Singh
Last edited by RavinderSingh13; 12-16-2014 at 09:54 AM..
Hi!
I have thousands of sub-directories, and hundreds of thousands of files in them. What is the fast way to find out which files are older than a certain date? Is the "find" command the fastest? Or is there some other way?
Right now I have a C script that traverses through and checks... (5 Replies)
Hi,
I am trying to write a script that will move all the files from source directory structure(multiple levels might exist) to destination directory structure. If a sub directory in source doesnot exist in destination then I have to skip and goto next level. I also need to delete the files in... (1 Reply)
Here is my problem (it seems I've a lot of problems nowadays).
I have several folders:
runner.20070830.12.45.12
runner.20070830.12.45.15
runner.20070830.12.45.17
runner.20070830.12.45.20
runner.20070830.12.45.45
runner.20070830.12.45.55
Each catalog contains some html-files.
I... (3 Replies)
Hi,
I need to check a flatfile for various parameters like length of the record, format of record, any tab character present in the record etc.,
for checking presence of tab character, i'm trying to use the following code and i'm not sure if the same is right. Pls Help.
nawk '{print... (1 Reply)
Hi All,
My UNIX Version is:
OS Name Release Version
AIX appma538 3 5
I want to find certain files with some criterias under the given path. At the same time i want to find the files which resides under the given directory, but normal find traverse to its sub-directories... (4 Replies)
hi
I have a directory structure like
Parent
Parent/child1/
Parent/child2/
Parent/child3/ and the each main directory contains
Parent/child1/file1.txt, Parent/child1/fil2.zip .......
Parent/child2/file1.txt,Parent/child/fil2.zip ......
Now i want to traverse to each and want to... (1 Reply)
Hello,
I need help in creating a PERL script for parsing test result files to get the results (pass or fail). Each test case execution generates a directory with few files among which we are interested in .result file.
Lets say Testing is home directory. If i executed 2 test cases. It will... (4 Replies)
flamingo:~ joliver$ sudo find / -nogroup
find: /dev/fd/4: No such file or directory
find: /home: No such file or directory
find: /Library: No such file or directory
find: /net: No such file or directory
find: /Network: No such file or directory
find: /private: No such file or directory
find:... (2 Replies)
I wish to traverse the latest to the oldest directory based on its timestamp.
ls -ltr
drwxr-x--- 3 admin bel 1024 Jan 22 02:29 sys
drwxr-x--- 2 admin bel 2048 Jan 22 02:30 admin
drwxr-x--- 10 admin bel 24576 Jan 23 21:31 bin
For the above i need to cd first to... (2 Replies)
i have a file like below
New_file.txt
123|345|ab cd|ef gh
345|456|jk hu|uyh
My script is
#!/bin/ksh
set -x
for line in `cat New_file.txt`
do
a1=`echo $line|cut -d '|' -f1`
echo $a1
done
output
++ cat New_file.txt (2 Replies)
Discussion started by: Rajesh_us
2 Replies
LEARN ABOUT DEBIAN
save_binary_logs
SAVE_BINARY_LOGS(1p) User Contributed Perl Documentation SAVE_BINARY_LOGS(1p)NAME
save_binary_logs - Concatenating binary or relay logs from the specified file/position to the end of the log. This command is automatically
executed from MHA Manager on failover, and manual execution should not be needed normally.
SYNOPSIS
# Test
$ save_binary_logs --command=test --binlog_dir=/var/lib/mysql --start_file=mysqld-bin.000002
# Saving binary logs
$ save_binary_logs --command=save --binlog_dir=/var/lib/mysql --start_file=mysqld-bin.000002 --start_pos=312
--output_file=/var/tmp/aggregate.binlog
# Saving relay logs
$ save_binary_logs --command=save --start_file=mysqld-relay-bin.000002 --start_pos=312 --relay_log_info=/var/lib/mysql/relay-log.info
--output_file=/var/tmp/aggregate.binlog
save_binary_logs concatenates binary or relay logs from the specified log file/position to the end of the log. This tool is intended to be
invoked from the master failover script(MHA Manager), and manual execution is normally not needed.
DESCRIPTION
Suppose that master is crashed and the latest slave server has received binary logs up to mysqld-bin.000002:312. It is likely that master
has more binary logs. If it is not sent to the slave, slaves will lose all binlogs from mysqld-bin.000002:312. The purpose of the
save_binary_logs is to save binary logs that are not replicated to slaves. If master is reachable through SSH and binary logs are readable,
saving binary logs is possible.
Here is an example:
$ save_binary_logs --command=save --start_file=mysqld-bin.000002 --start_pos=312 --output_file=/var/tmp/aggregate.binlog
Then all binary logs starting from mysqld-bin.000002:312 are concatenated and stored into /var/tmp/aggregate.binlog. If you have binary
logs up to mysqld-bin.000004, the following mysqlbinlog outputs are written.
mysqld-bin.000002:Format Description Event(FDE), plus from 312 to the tail mysqld-bin.000003:from 0 to the tail, excluding FDE
mysqld-bin.000004:from 0 to the tail, excluding FDE
perl v5.14.2 2012-01-08 SAVE_BINARY_LOGS(1p)