in reply to Re: Crontab "Can't open perl script", " No such file or directory"
in thread Crontab "Can't open perl script", " No such file or directory"

Given the reply earlier about single hard drive on laptop, I would think that the directory (or, parent) would be already mounted and thus removes automount or similar. (The explicit question was still not answered.)

Could it be possible that that a bad "shebang" line (not shown), if present, would be causing the problem even though the program is started explicitly via /usr/bin/perl per OP?

  • Comment on Re^2: Crontab "Can't open perl script", " No such file or directory"
  • Download Code

Replies are listed 'Best First'.
Re^3: Crontab "Can't open perl script", " No such file or directory"
by Nemo Clericus (Beadle) on Oct 09, 2014 at 17:36 UTC

    That would be a very odd situation indeed considering he said it does run sometimes. If there was an issue determining what binary would interpret the file, it shouldn't ever run.

      successful execution manually:
      :~$ bash -l -c '/usr/bin/perl /home/myuser/scripts/perl/flash.pl' running for: 2014-10-08 get, success 148847 bytes of data. Number of rows affected: 0 :~$ /usr/bin/perl /home/myuser/scripts/perl/flash.pl running for: 2014-10-08 get, success 148847 bytes of data. Number of rows affected: 0 :~/scripts/perl$ ./flash.pl running for: 2014-10-08 get, success 148847 bytes of data. Number of rows affected: 0

        Strange. Just some debugging ideas: what happens when running the following commands from the crontab:

        • ls -l /home/myuser/scripts/perl/
        • ls -l /usr/bin/perl
        • file /home/myuser/scripts/perl/flash.pl
        • head /home/myuser/scripts/perl/flash.pl
        • /usr/bin/perl -le 'print "Hello, World"'
      :~$ bash -l -c '/usr/bin/perl /home/myuser/scripts/perl/flash.pl' running for: 2014-10-08 get, success 148847 bytes of data. Number of rows affected: 0 :~$ /usr/bin/perl /home/myuser/scripts/perl/flash.pl running for: 2014-10-08 get, success 148847 bytes of data. Number of rows affected: 0 :~/scripts/perl$ ./flash.pl running for: 2014-10-08 get, success 148847 bytes of data. Number of rows affected: 0