HEX
Server: Apache/2.4.38 (Debian)
System: Linux mtefpls 4.19.0-18-amd64 #1 SMP Debian 4.19.208-1 (2021-09-29) x86_64
User: www-data (33)
PHP: 7.3.31-1~deb10u1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: //bin/bf_copy
#! /bin/sh

#  bf_copy [-c] source_dir dest_dir
#
#    use to copy wordlist.db and related files
#    from one directory to another

# $Id: bf_copy.in 6750 2008-10-15 23:18:45Z clint $

set -e # die on errors

: ${BOGOUTIL:=bogoutil}

COMPACT=0
while test "$1" ; do
    case "$1" in
	-c) COMPACT=1 ;;
	--) shift ; break ;;
	-*) echo "unknown option $1" >&2 ; exit 1 ;;
	*) break;
    esac
    shift
done

if [ $# -ne 2 ] ; then
    echo 'usage: bf_copy [-c] source_dir dest_dir'
    echo "   use -c to copy active logs, not all"
    exit 1
fi

SRC="$1"
DST="$2"

# flush mempools
$BOGOUTIL --db-checkpoint="$SRC" || :

mkdir "$DST"

TMP=bfc.$$.unneeded
rm -f $TMP
trap "rm -rf $TMP \"$DST\"" 0
if test $COMPACT -eq 1 ; then
  # don't copy unneeded logs
  $BOGOUTIL --db-list-logfiles="$SRC" >$TMP
else
  : >$TMP
fi

# XXX FIXME - use Berkeley DB environment probing here
LOGS=`ls "$SRC"/log.* 2>/dev/null | grep -v -F -f $TMP || :`
if test "$LOGS" ; then cp -p $LOGS "$DST" ; fi
if test -f "$SRC"/DB_CONFIG ; then cp -p "$SRC"/DB_CONFIG "$DST" ; fi

for FILE in "$SRC"/*.db ; do
    SIZE=`$BOGOUTIL --db-print-pagesize="$FILE"`
    dd bs=$SIZE if=$FILE of="$DST/"`basename "$FILE"`
done

if test "$LOGS" ; then $BOGOUTIL --db-recover="$DST" ; fi
rm -f $TMP
trap - 0