Backup using Ccollect and a TomatoUSB router

Ccollect is a pretty simple tool to do incremental backups, and it works easily on a small router with TomatoUSB.

  • install coreutils
  • install openssh
  • create ~/.ssh/config
    nvram setfile2nvram /home/root/.ssh/config
    nvram commit
  • to delete:
    nvram unset FILE=/home/root/.ssh/config; nvram commit)
  • create a symlink on boot
    • this would not work in the UI admin -> script -> init:
      ln -s /tmp/mnt/OPTWARE/ccollect/ssh_config /home/root/.ssh/config
    • but this worked: admin -> scrips -> firewall:
      ln -s /tmp/mnt/OPTWARE/ccollect/ssh_config /home/root/.ssh/config
  • ccollect script bk_domain.sh:
#!/bin/sh export PATH="/opt/bin:$PATH"
/tmp/mnt/OPTWARE/ccollect/ccollect daily domain.name
  • add schedule in admin-sched.asp
  • exclude file on local
    /proc /dev /sys /lost+found /bin /boot /initrd /lib /sbin /tmp /usr
    /vmlinuz /vmlinuz.old /var/lib/mysql
  • backup mysql in a cron
    01 01 * * * /usr/bin/mysqldump --all-databases | gzip > /backup/folder/mysql-$((RANDOM)).gz
  • links