2

We are using rsnapshot for backups. It uses hard links to efficiently store unchanged files, and rsyncs the changed files from servers.

The hard linking part calls a command like this

  cp -al /current /old

But this process uses up ALL the available memory. Is there a way to limit memory of cp process, or is there a memnice utility a la nice/ionice?

hayalci
  • 3,631
  • 3
  • 27
  • 37

1 Answers1

3

rsnapshot includes support for --link-dest support using rsync which would avoid the cp -al step. Rsync 3.0+ doesn't have to keep the entire directory tree in memory and would probably work better in your situation.

karmawhore
  • 3,865
  • 18
  • 9
  • 1
    The --link-dest patch was written by the original author of dirvish (which is similar to rsnapshot but more complex/powerful), probably to overcome the limitations of cp -al. – Andrew Jul 01 '10 at 03:31
  • that changed the backup time from 15+ hours to just 6 hours. Thanks :) – hayalci Jul 05 '10 at 08:11
  • There's more discussion on an [alternative technique here](http://sourceforge.net/mailarchive/forum.php?thread_name=87ir4l35t6.wl%25peter%40chubb.wattle.id.au&forum_name=rsnapshot-discuss) - basically rotating the last hourly snapshot into the new one and doing a `cp -afl` from `hourly.1` onto `hourly.0` but I haven't tried that - you'd have to do the rotation manually rather than relying on `rsnapshot` to do it – David Fraser Jul 22 '11 at 08:00
  • @DavidFraser The link is broken. – Koshur Jun 25 '19 at 05:24
  • Found an updated link: [rsnapshot-discuss Speeding up rsnapshot: eliminating the cp -al](https://sourceforge.net/p/rsnapshot/mailman/message/8210381/) – David Fraser Jun 26 '19 at 10:27