I'm trying to write a script to back up with rsync, the script I am posting below:
nomServer="shiva horus isis"
dirshiva="/etc /faturamento"
shivaListExc="/usr/local/bin/shivaListExclRsync"
dumpDir="$dumpFile/Shiva"
dateBkp=`date +%A`
for nServer in ${nomServer}
do
... (3 Replies)
Hi all,
Im trying to make a proper hosts.allow with the lists of sshbl.org to block the ssh brute force attackers.
The list is a text file with an IP on every line.
What I've gotten up sofar is to prefix "sshd : " on every line, but I need a " : deny" suffix behind every line as well. ... (9 Replies)
Hi ! I'm working into my first bash script to make some xml modification and it's going to make me crazy lol .. so I decide to try into this forum to take some ideas from people that really know about this!
This is my situation I've and xml file with a lots of positional values with another tags... (9 Replies)
Ok, so I have a bash script with an embedded expect statement.
Inside of the expect statement, i'm trying to pull all of the non-comment lines from the /etc/oratab file one at a time.
Here's my command:
cat /etc/oratab |sed /^s*#/d\ | awk 'NR==1'|awk -F: '{print \"$1\"}'|. oraenv
Now,... (0 Replies)
#!/bin/bash
currentdatee=$(date +%D-%R)
rsync -autb --backup-dir="/home/kyle/USBSYNC/OLDFILES/CRUZEREDGE1/" --suffix="$currentdatee" /mnt/backup/* /home/kyle/USBSYNC/CRUZEREDGE1/
The rsync line simply doesn't work when I try this. It'll work if I make the suffix something static. I feel... (1 Reply)
Hello,
My Bash script is working but i dont know batch programing, anyone can help me?
I dont want use programs to do this task, i will use in many computers...
Bash:
My work until now... BATCH:
Thanks for help. (1 Reply)
Hi,
I have two files: a.doc and b.txt
I wish to search the strings from file b.txt in a.doc and want to highlight them in a.doc with different colours using Perl or bash./awk/sed?
Please guide me. :)
Thanks!!!!! (10 Replies)
I am having trouble re-writing this sed code
sed -nr 's/.*del(+)ins(+).*NC_0{4}(+).*g\.(+)_(+).*/\3\t\4\t\5\t\1\t\2/p' C:/Users/cmccabe/Desktop/Python27/out_position.txt > C:/Users/cmccabe/Desktop/Python27/out_parse.txt in perl Basically, what the code does is parse text from two fields... (12 Replies)
Guys, I have a variable in a script that I want to transform to into something else Im hoping you guys can help. It doesn't have to use sed/awk but I figured these would be the simplest.
DATE=20160120
I'd like to transform $DATE into "01-20-16" and move it into a new variable called... (8 Replies)
Please help me to get required output for both scenario 1 and scenario 2 and need separate code for both scenario 1 and scenario 2
Scenario 1
i need to do below changes only when column1 is CR and column3 has duplicates rows/values. This inputfile can contain 100 of this duplicated rows of... (1 Reply)
Discussion started by: as7951
1 Replies
LEARN ABOUT NETBSD
humanize_number
HUMANIZE_NUMBER(9) BSD Kernel Developer's Manual HUMANIZE_NUMBER(9)NAME
humanize_number, format_bytes -- human readable numbers
SYNOPSIS
int
humanize_number(char *buf, size_t len, uint64_t number, const char *suffix, int divisor);
int
format_bytes(char *buf, size_t len, uint64_t number);
DESCRIPTION
The humanize_number() function formats the unsigned 64-bit quantity given in number into buf. A space and then suffix is appended to the
end. The supplied buf must be at least len bytes long.
If the formatted number (including suffix) is too long to fit into buf, humanize_number() divides number by divisor until it will fit. In
this case, suffix is prefixed with the appropriate SI designator. Suitable values of divisor are 1024 or 1000 to remain consistent with the
common meanings of the SI designator prefixes.
The prefixes are:
Prefix Description Multiplier
k kilo 1024
M mega 1048576
G giga 1073741824
T tera 1099511627776
P peta 1125899906842624
E exa 1152921504606846976
The len argument must be at least 4 plus the length of suffix, in order to ensure a useful result in buf.
The format_bytes() function is a front-end to humanize_number(). It calls the latter with a suffix of ``B''. Also, if the suffix in the
returned buf would not have a prefix, the suffix is removed. This means that a result of ``100000'' occurs, instead of ``100000 B''.
RETURN VALUES
Both functions return the number of characters stored in buf (excluding the terminating NUL) upon success, or -1 upon failure.
SEE ALSO humanize_number(3)HISTORY
These functions first appeared in NetBSD 1.5.
BSD August 7, 2010 BSD