I currently run a script over a vpnc tunnel to back-up my data to a remote server. However for a number of reasons the tunnel often collapses. If I manually restore the tunnel then the whole thing can continue, but I want to add into my script a section whereby while the transfer is taking place,... (8 Replies)
Hi all,
I am working on a backup based script, in which it enters to a directory and check the sub-directories and copy the names into an array.
cd $CPFs
k=0
for i in *
do
if
then
ARRs="$i"
k=$(($k+1))
#echo "$i"
... (19 Replies)
I'm reading about debugging aids in bash and have come across the set command. It says in my little book that an addition to typing
set
you can also use them "on the command line when running a script..." and it lists this in a small table:
set -o option Command Line... (5 Replies)
Hi,
I am writing a script to split a log file - the log could contain multiple days worth of logs. The second line of the log contains the string "Version ". In my test log which comprises of two days worth of logs, this string appears twice - once each day.
Essentially I would like to split... (7 Replies)
I am trying to look through one of my directories to remove certain files. I am pretty new to Unix and bash so I just need a little help in starting this. I know I would have to write two loops one to iterate the directories and one to iterate the files. How would I write the loops? (3 Replies)
Hi,
I am trying to do something similar to the for loop example from KSH For Loop Array: Iterate Through Array Values
$: cat y.ksh
#!/bin/ksh
# set array called nameservers
set -A nameservers 192.168.1.1 192.168.1.5 202.54.1.5
# print all name servers
for i in ${nameservers}
do
... (3 Replies)
I am trying to write a Bash Script using a couple of arrays. I need to perform a countdown of sorts on an array done once daily, but each day would start with the numbers from the previous day. This is what I'm starting with :
#!/bin/bash
days=(9 8 7 6 5)
for (( i = 0 ; i < ${#days} ; i++... (4 Replies)
Hello,
i have a script that should compare between ${ARRAY}
that contains all fstab record like this :
>>echo ${ARRAY}
/ /boot
between all mountpoints in my df that is stord in ${ARRAY2}
>>echo ${ARRAY2}
/ /boot /dev/shm /var/spool/asterisk/monitor
now i have this loop:
for i in... (6 Replies)
I am running plsql using printf on a shell, but i am getting some strange error, can someone point what exactly am i missing,
$ echo $SHELL
/bin/bash
$ printf "
> SET serveroutput ON trimspool on feed off echo off
> declare
> p_val number;
> d_val varchar2(10);
> begin
> SELECT... (1 Reply)
Discussion started by: kamauv234
1 Replies
LEARN ABOUT PHP
mongocommandcursor
MONGOCOMMANDCURSOR(3) 1 MONGOCOMMANDCURSOR(3)The MongoCommandCursor classINTRODUCTION
A command cursor is similar to a MongoCursor except that you use it for iterating through the results of a database command instead of a
normal query. Command cursors are useful for iterating over large result sets that might exceed the document size limit (currently 16MB) of
a single MongoDB.command(3) response.
While you can create command cursors using MongoCommandCursor.__construct(3) or the MongoCommandCursor.createFromDocument(3) factory
method, you will generally want to use command-specific helpers such as MongoCollection.aggregateCursor(3).
Note that the cursor does not "contain" the database command's results; it just manages iteration through them. Thus, if you print a cur-
sor (f.e. with var_dump(3) or print_r(3)), you will see the cursor object but not the result documents.
CURSOR STAGES
A MongoCommandCursor has two "life stages": pre- and post- command. When a cursor is created, it has not yet contacted the database, so it
is in its pre-command state. When the client first attempts to get a result (by calling MongoCommandCursor.rewind(3), directly or indi-
rectly), the cursor moves into the post-command state.
The command cursor's batch size and socket timeout may be configured in both the pre- and post- command states.
Example #1
Adding options to MongoCommandCursor
<?php
$cursor = new MongoCommandCursor(...);
$cursor = $cursor->batchSize( 4 );
foreach ($cursor as $result) {
var_dump($result);
}
?>
CLASS SYNOPSIS
MongoCommandCursor
MongoCommandCursorMongoCursorInterfaceIterator
Methods
o public MongoCommandCursor MongoCommandCursor::batchSize (int $batchSize)
o public MongoCommandCursor::__construct (MongoClient $connection, string $ns, array $command = array())
o publicstatic MongoCommandCursor MongoCommandCursor::createFromDocument (MongoClient $connection, string $hash, array $document)
o public array MongoCommandCursor::current (void )
o public bool MongoCommandCursor::dead (void )
o public array MongoCommandCursor::getReadPreference (void )
o public array MongoCommandCursor::info (void )
o public int MongoCommandCursor::key (void )
o public void MongoCommandCursor::next (void )
o public array MongoCommandCursor::rewind (void )
o public MongoCommandCursor MongoCommandCursor::setReadPreference (string $read_preference, [array $tags])
o public MongoCommandCursor MongoCommandCursor::timeout (int $ms)
o public bool MongoCommandCursor::valid (void )
SEE ALSO
o MongoDB::command
o MongoCollection::aggregateCursor
PHP Documentation Group MONGOCOMMANDCURSOR(3)