rstats backup in the cloud and RAF 1.28 ND + VPN

Discussion in 'Tomato Firmware' started by lanmtl, Oct 12, 2010.

  1. lanmtl

    lanmtl Addicted to LI Member

    I used to use RAF 1.25 and backup my rstats online.
    I upgraded to 1.28 ND VPN and it doesn't work anymore.

    logs say
    Code:
    Oct 11 19:24:01 routage user.notice root: RStats Restore Failed... will retry
    
    Script is:
    WAN Up
    Code:
    USER="*******"
    PASS="*******"
    PORT=21
    SERVER="ftpperso.tld"
    RPATH="tomato/rstats.tar"
    LPATH="/tmp/rstats.tar"
    
    if [ ! -s /tmp/backup-rstats ] ; then
        echo -e "#!/bin/sh\nkillall -1 rstats\nsleep 1\ntar c /tmp/var/lib/misc/rstats-* > \"$LPATH\"\nftpput -u \"$USER\" -p \"$PASS\" -P $PORT $SERVER \"$RPATH\" \"$LPATH\"\nrm \"$LPATH\"" > /tmp/backup-rstats
        chmod 777 /tmp/backup-rstats
        echo -e "#!/bin/sh\nservice rstats stop\nftpget -u \"$USER\" -p \"$PASS\" -P $PORT $SERVER \"$LPATH\" \"$RPATH\"" > /tmp/restore-rstats
        echo -e "if [ \$? != 0 ] ; then\n  logger RStats Restore Failed... will retry\n  cru a rstats \"*/1 * * * * /tmp/restore-rstats\"\n  return 1\nfi\ntar x -f \"$LPATH\" -C /\nrm \"$LPATH\"\nservice rstats start\ncru a rstats \"1 * * * * /tmp/backup-rstats\"" >> /tmp/restore-rstats
        echo -e "logger RStats Data Restored\nrm /tmp/restore-rstats" >> /tmp/restore-rstats
        chmod 777 /tmp/restore-rstats
        /tmp/restore-rstats
    fi
    Shutdown
    Code:
    if [ ! -s /tmp/restore-rstats ] ; then  {make sure any previous restore was successful, or we will overwrite the backup with nothing...}
    /tmp/backup-rstats
    fi
    When I go to the rstats page it says
     
  2. landa

    landa LI Guru Member

  3. lanmtl

    lanmtl Addicted to LI Member

    Awesome, thanks a lot!
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice