I have searched the Internet for hours for a solution to my issue, and I can't seem to find an answer or solve what I'm doing wrong. I am trying to set up a cron to run a perl script on a regular basis. I am using Ubuntu 18.04.3 LTS as a virtual machine on Oracle VM Virtualbox 5.2.26, running on a Windows 10 host.
I have not been successful running the perl script, so I have tried execute a number of other commands to test what I'm doing wrong. I'm having issues running a number of commands found in the /usr/bin/ path. I have been able to execute 'echo' and 'printf', but that's about it. Below is my code and the error messages I am receiving from each line (note the 'echo "$PATH"' line seems to work correctly):
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/home/myname/Alpha/ATK_queries
SHELL=/bin/bash
MAILTO=email@gmail.com
2 * * * * /usr/bin/env
2 * * * * env
2 * * * * echo "$PATH"
2 * * * * perl atk_queries.pl
2 * * * * /usr/bin/perl /home/myname/Alpha/ATK_queries/atk_queries.pl
2 * * * * perl /home/myname/Alpha/ATK_queries/atk_queries.pl
Output/Errors In Order of Commands:
(1) /bin/bash: /usr/bin/env: No such file or directory
(2) /bin/bash: $'env\r': command not found
(3) /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/home/myname/Alpha/ATK_queries
(4) Can't open perl script "atk_queries.pl": No such file or directory
(5) Can't open perl script "/home/derek/Alpha/ATK_queries/atk_queries.pl": No such file or directory
(6) Can't open perl script "/home/derek/Alpha/ATK_queries/atk_queries.pl": No such file or directory
Any guidance is greatly appreciated.
env\r
output, can you check if you have a problem with your line endings? See here and here for details. – Haxiel Dec 02 '19 at 17:04