Search Results

Search: Posts Made By: Abu Rayane
4,833
Posted By Neo
Normally, It is a good idea to start from...
Normally,

It is a good idea to start from the top, but the method is up to you:

Comment out all the lines except for the top line, flush iptables, reapply and test.

If it works,...
8,455
Posted By RudiC
Follow ChublerXL advice. Use a less complex...
Follow ChublerXL advice. Use a less complex script, one or two lines, echoes; redirect stderr, too. Post the log files.
8,455
Posted By Chubler_XL
Have you considered inotifywait(1)...
Have you considered inotifywait(1) (https://www.unix.com/man-page/debian/1/inotifywait/) provided by the inotify-tools package on some distributions, this can run your script whenever a file appears...
942
Posted By rbatte1
If you want the md5 operation output, use md5sum...
If you want the md5 operation output, use md5sum instead of ckcum

If you have lots of files and you should be ensuring that they are identical (i.e. no files missing or extra on the target) you...
942
Posted By jim mcnamara
rsync does that, called a hash code. If the hash...
rsync does that, called a hash code. If the hash code fails rsync barfs all over the place. However to answer your question:

There are several programs for this, but cksum is more than adequate....
2,066
Posted By Don Cragun
Without a clear example of the output you hope to...
Without a clear example of the output you hope to get and a display showing the file hierarchy you're trying to process, it is impossible to guess at what output you want. But, if you just want a...
1,293
Posted By Don Cragun
The bash read built-in on my system doesn't have...
The bash read built-in on my system doesn't have a -i init_string option, but after adjusting for that, I found that no matter what value I entered in response to the second prompt, eEpisode was...
2,272
Posted By Don Cragun
I gave you three suggestions in post #12 in this...
I gave you three suggestions in post #12 in this thread that will probably work on most, if not all, of your systems. If you choose to ignore that advice, and insist on executing you bash scripts...
7,329
Posted By RudiC
You may find additional inspiration in the many...
You may find additional inspiration in the many many threads in these fora dealing with df and mailing its results.
7,329
Posted By Don Cragun
In the script: df -h | { read REST while...
In the script:
df -h | {
read REST
while read FS SZ AV US PC MT REST
do useSpPer=${useSpPer}'-'$PC
echo 'use '$useSpPer
echo 'res '$PC
done
echo final $useSpPer
}
there is nothing...
7,329
Posted By Don Cragun
From the heading you used in post #1 in this...
From the heading you used in post #1 in this thread:
Filesystem Size Used Avail Use% Mounted on
It looks to me like the reads should be changed from:
read REST; while read FS SZ AV US PC MT...
7,329
Posted By Corona688
To explain how this works, this doesn't avoid the...
To explain how this works, this doesn't avoid the subshell problem, as much as put the entire relevant program inside the subshell so nothing loses context.
7,329
Posted By Aia
Only Bash, Zsh and Ksh93 supports process...
Only Bash, Zsh and Ksh93 supports process substitution, which is what the <(...) means. Since you are invoking it with sh, judging by this # sh disk.sh , I suggest you use the command grouping
...
7,329
Posted By MadeInGermany
When you pipe something to a block, the block...
When you pipe something to a block, the block runs in a sub-shell.
Variables in the block are not copied back to the main shell.

A while loop is such a block.
In RudiC example the { } is the...
7,329
Posted By RudiC
Try this pure shell:df -h | { read REST; while...
Try this pure shell:df -h | { read REST; while read FS SZ AV US PC MT REST; do useSpPer=${useSpPer}'-'$PC; echo 'use '$useSpPer; echo 'res '$PC; done; echo final $useSpPer; }
use -28%
res 28%...
7,329
Posted By cero
Hi, the effect you see is caused by the way you...
Hi,
the effect you see is caused by the way you feed your loop. The pipe creates a subshell which has its own copies of the variables, the ones in the parent shell are not affected by actions in the...
1,660
Posted By Scrutinizer
Sure: awk ' $2!="OK" { # if the...
Sure:
awk '
$2!="OK" { # if the second field is not equal to OK
t++ # increase total
$2="(" $2 # prepend opening parenthesis to the second field...
1,660
Posted By Scrutinizer
Try: awk '$2!="OK"{t++; $2="(" $2; $NF=$NF ")";...
Try:
awk '$2!="OK"{t++; $2="(" $2; $NF=$NF ")"; s=s $0 "\n" } END{printf "The number of damaged tables is %s\n\n%s",t,s}' file

You can put it in a variable:
nCheck=$(awk '$2!="OK"{t++; $2="("...
1,660
Posted By krishmaths
grep -v "OK" is another option to exclude lines...
grep -v "OK" is another option to exclude lines with string "OK".

In your awk command, try printing entire line instead of just first field using just print or print $0
1,209
Posted By balajesuri
ignoreTables=( visitors_15012016...
ignoreTables=( visitors_15012016 visitors_Original )

ignoreString=''
for tbl in ${ignoreTables[@]}
do
ignoreString=${ignoreString}"--ignore-table="${tbl}" "
done

mysqldump...
Showing results 1 to 20 of 20

 
All times are GMT -4. The time now is 05:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy