On 12-06-03 06:00 PM, Octavian Rasnita wrote:
The cron jobs don't use the system Perl, but they use the first Perl
found in PATH.
If those cron jobs won't find any Perl in PATH, they won't run at all.
And you, or Perlbrew or somebody else should set a default PATH for the
shell which is used by the cron jobs if you want a certain version of
Perl to be run.

According to crontab(5), /usr/bin/perl

Copy the attached to your bin and add this line to the top of your crontab file:

SHELL=/bin/bash

Then change each Perl entry to:

* * * * * /home/my_username/bin/init_perlbrew.sh my_script.pl arg1 arg2

Replacing the asterisks, my_username, my_script.pl, and its arguments with the appropriate values.

Now, when you `perlbrew switch`, the next time a cron(8) job starts, it will run under the switched perl. Those currently running will not changed; they would have to be stopped and restarted.


--
Just my 0.00000002 million dollars worth,
  Shawn

Programming is as much about organization and communication
as it is about coding.

        _Perl links_
official site   : http://www.perl.org/
beginners' help : http://learn.perl.org/faq/beginners.html
advance help    : http://perlmonks.org/
documentation   : http://perldoc.perl.org/
news            : http://perlsphere.net/
repository      : http://www.cpan.org/
blog            : http://blogs.perl.org/
regional groups : http://www.pm.org/

Attachment: init_perlbrew.sh
Description: application/shellscript

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/

Reply via email to