4

Trying to make a backup of Ubuntu server using rsnapshot, here is my config file:

config_version  1.2
snapshot_root   /root/backups
cmd_cp      /bin/cp
cmd_rm      /bin/rm
cmd_rsync   /usr/bin/rsync
cmd_ssh     /usr/bin/ssh
cmd_logger  /usr/bin/logger
retain      hourly  6
retain      daily   7
retain      weekly  4
retain      monthly 3
verbose     3
loglevel    4
logfile     /root/backups/rsnap.log
lockfile    /root/backups/rsnap.pid
backup      root@server:/   server/ 
exclude     /dev/*
exclude     /home/*/.gvfs
exclude     /home/*/logs/
exclude     /media/*
exclude     /mnt/*
exclude     /proc/*
exclude     /sys/*
exclude     /tmp/*
exclude     /home/*/.local/share/Trash
exclude     /etc/fstab
exclude     /var/run/*
exclude     /var/lock/*
exclude     /var/log/*
exclude     /lib/modules/*/volatile/.mounted
exclude     /var/cache/apt/archives/*

how can I limit the rate at which it downloads? With the way it is now, remote server is running very slowly during backup.

sam
  • 41
  • 1

1 Answers1

4

This answer is probably a bit late but for future reference:

I used the --bwlimit parameter for rsync for limiting directory backups. You can either set it globally for all directory backups:

rsync_long_args    --bwlimit=1MiB

or append to particular backup jobs:

backup    root@server:/path/    server/    +rsync_long_args=--bwlimit=1MiB

For script jobs which do not utilize rsync this is not applicable. But I take it most jobs use a pipe to write data into a file. You can use the pv tool (apt-get install pv) to limit the bandwidth of the pipe which eventually limits the rate of the writing command like ssh:

backup_script    /usr/bin/ssh root@server 'mysqldump ...' | /usr/bin/pv --quiet --rate-limit 1m > mysql_backup.sql    server_mysql/

Note that I can't post tab stops here but every occurrence of 4 spaces like needs to a be a tab stop in the rsnapshot.conf format.

Daniel Böhmer
  • 271
  • 2
  • 13
  • I get an error when trying this: `root@test.de:/media/snapshots/tmp-vm08disk/etc/ xen-test.de/ +rsync_longs_args=--bwlimit=10MiB` `+rsync_longs_args=--bwlimit=10MiB - Syntax \ error on line 392 in extra opts: \ +rsync_longs_args=--bwlimit=10MiB` – rubo77 May 31 '23 at 12:09
  • 1
    I think it's Called `rsync_long_args` (without s) – rubo77 May 31 '23 at 19:42