Rsync in cron

I've installed some rsync scripts to a RHEL6 cron yesterday, but this morning I was surprised with error messages in my mailbox:

/etc/bashrc: fork: retry: Resource temporarily unavailable
/etc/bashrc: fork: Resource temporarily unavailable
rsync: connection unexpectedly closed (0 bytes received so far) [receiver]

When you see resource temporarily unavailable you can be sure it is most likely some system limit issue, or your box is really running out of resources (worse case). The issue was I was calling the script from crontab and my limits was apparently set up incorrectly.

The trick was to modify those. I took the easiest method of modifying the script itself. So I went for:

#!/bin/bash
ulimit -d unlimited
ulimit -m unlimited
ulimit -s unlimited
rsync [...]

And it's working again.

By the way we just started building our Katello open-source project using our own Koji. Kudos to Mirek Suchý and other Satellite folks. Repositories (nightlies at the moment) are available here.
19 July 2012 | katello | bash | rhel6
twitter.com linkedin.com
google.com/+ facebook.com
flickr.com youtube.com