On Jun 3, 2012, at 10:29 PM, Wybo Dekker wrote:

> On 2012-06-02 22:03, Florian Gilcher wrote:
>>=20
>> On Jun 2, 2012, at 9:35 PM, Arun Tomar wrote:
>>=20
>>> On 06/03/2012 12:57 AM, Wybo Dekker wrote:
>>>> I have, for the first time, installed ruby using rvm.
>>>> I run my backups via crontab, calling a bash script that runs a =
ruby
>>>> script. However, that script now tell me that it doesn't know about =
ruby.
>>>> So I entered two lines in the bash script:
>>>>=20
>>>>  RVM=3D/usr/local/rvm/scripts/rvm
>>>>  test -e $RVM && source $RVM
>>>>=20
>>>> and it runs OK; but it seems to me that this is not the way it =
should be
>>>> done. Is it?
>>>>=20
>>>=20
>>> Cron runs as sh shell. it doesn't read bashrc or profile.d files =
like
>>> rvm.sh. so it will not know where to find ruby that's installed in =
rvm.
>>>=20
>>> for one of our project this is how we've been running things:
>>>=20
>>> Note : We recommend to add cron job for checking the available =
network connections. Add following into the crontab :=20
>>>    */5 * * * * bash -c 'source /etc/profile.d/rvm.sh && /usr/bin/env =
ruby /usr/local/rvm/gems/ruby-1.9.3-p125/bin/ispunity monitor'
>>>=20
>>> also have a look at this
>>>=20
>>> https://rvm.io/integration/cron/
>>=20
>> Newer RVMs also have a script called `rvm_shell`.
>>=20
>>  $RVM_INSTALL_LOCATION/bin/rvm_shell 1.9.3 -c 'ispunity monitor'
>=20
> That would better, because calling something containing the 1.9.3-p125
> would have to be changed with every change of the ruby version.
> However, although I suppose I have the newest rvm (1.14.0), I have no
> rvm_shell


I am sorry, it is "rvm-shell".

[ skade Florian-Gilchers-MacBook-Pro ~ ] which rvm-shell
/Users/skade/.rvm/bin/rvm-shell
[ skade Florian-Gilchers-MacBook-Pro ~ ] rvm --version

rvm 1.12.1 () by Wayne E. Seguin <wayneeseguin / gmail.com>, Michal Papis =
<mpapis / gmail.com> [https://rvm.io/]

Regards,
Florian

--
Florian Gilcher

smtp:   flo / andersground.net
jabber: Skade / jabber.ccc.de
gpg:    533148E2