Hirdetés

Új hozzászólás Aktív témák

  • Badb0y

    addikt

    válasz vargalex #8819 üzenetére

    Ez az S10cron file tartalma:

    #!/bin/sh
    #
    # Startup script for cron

    PIDFILE=/opt/var/run/cron.pid

    case $1 in
    start)
    /opt/sbin/cron
    ;;
    stop)
    [ -f ${PIDFILE} ] && kill `cat ${PIDFILE}` ;;
    *)
    echo "usage: $0 (start|stop)"
    exit 1
    esac

    Ez pedig a vnstat.conf:

    # vnStat 1.6 config file
    ##

    # location of the database directory
    DatabaseDir "/opt/var/lib/vnstat"

    # locale (LC_ALL)
    Locale "en_US"

    # on which day should months change
    MonthRotate 1

    # date output formats for -d, -m, -t and -w
    # see 'man date' for control codes
    DayFormat "%d.%m."
    MonthFormat "%b '%y"
    TopFormat "%d.%m.%y"

    # characters used for visuals
    RXCharacter "%"
    TXCharacter ":"
    RXHourCharacter "r"
    TXHourCharacter "t"

    # default interface
    Interface "ppp0"

    # maximum bandwidth (Mbit) for all interfaces, 0 = disable feature
    # (unless interface specific limit is given)
    MaxBandwidth 100

    # interface specific limits
    # example 8Mbit limit for eth0 (remove # to activate):
    #MaxBWeth0 8

    # how many seconds should sampling for -tr take by default
    Sampletime 5

    # default query mode
    # 0 = normal, 1 = days, 2 = months, 3 = top10
    # 4 = dumpdb, 5 = short, 6 = weeks, 7 = hours
    QueryMode 0

    # database file locking (1 = enabled, 0 = disabled)
    UseFileLocking 1

    # how much the boot time can variate between updates (seconds)
    BootVariation 15

    Ez pedig a cron.d-n belül9 vnstat.sh

    #!/bin/sh

    dump_dir="/opt/share/vnstat/dumps/"

    vnstat --force --update --iface ppp0
    vnstat --force --update --iface vlan1
    vnstat --force --update --iface vlan0
    vnstat --force --update --iface eth1

    vnstat --dumpdb -i ppp0 > $dump_dir/vnstat_dump_ppp0
    vnstat --dumpdb -i vlan1 > $dump_dir/vnstat_dump_vlan1
    vnstat --dumpdb -i vlan0 > $dump_dir/vnstat_dump_vlan0
    vnstat --dumpdb -i eth1 > $dump_dir/vnstat_dump_eth1

Új hozzászólás Aktív témák