Crontab fails because shell path not foundScript not running in crontab, file not foundCan't access shell variable in crontab configurationRemoving Prior CrontabsCrontab script not runningCrontab not running entire script?Crontab env variables while using Dockercronjob cannot find environment variables defined in .bashrcCrontab says command not foundcrontab -e does not open the crontab for this userCannot run python script with cron

Watching something be written to a file live with tail

How much RAM could one put in a typical 80386 setup?

Fully-Firstable Anagram Sets

Languages that we cannot (dis)prove to be Context-Free

Is it possible to run Internet Explorer on OS X El Capitan?

How can bays and straits be determined in a procedurally generated map?

Is it tax fraud for an individual to declare non-taxable revenue as taxable income? (US tax laws)

Do infinite dimensional systems make sense?

Why is 150k or 200k jobs considered good when there's 300k+ births a month?

Was any UN Security Council vote triple-vetoed?

How is the claim "I am in New York only if I am in America" the same as "If I am in New York, then I am in America?

Revoked SSL certificate

Why doesn't Newton's third law mean a person bounces back to where they started when they hit the ground?

Why can't we play rap on piano?

Alternative to sending password over mail?

What's that red-plus icon near a text?

What does "Puller Prush Person" mean?

strTok function (thread safe, supports empty tokens, doesn't change string)

What are these boxed doors outside store fronts in New York?

Definite integral giving negative value as a result?

Codimension of non-flat locus

Why is consensus so controversial in Britain?

Do I have a twin with permutated remainders?

Is it possible to do 50 km distance without any previous training?



Crontab fails because shell path not found


Script not running in crontab, file not foundCan't access shell variable in crontab configurationRemoving Prior CrontabsCrontab script not runningCrontab not running entire script?Crontab env variables while using Dockercronjob cannot find environment variables defined in .bashrcCrontab says command not foundcrontab -e does not open the crontab for this userCannot run python script with cron






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















I am looking at the failure output of my crontab.



* * * * * user /usr/bin/python3 /home/user/src/code/prod.py


I get the error /bin/sh: 1: caleb: not found.



This corresponds to



X-Cron-Env: <SHELL=/bin/sh>


which is part of the email the crontab sent me. I created the crontab using



crontab -e


All of it looks like a simple setup is there anything that I am missing?










share|improve this question









New contributor




caleb baker is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.















  • 3





    When you run crontab -e it is already using your username so there is no need to add your username to the beginning of the command. The only place on the system that you add the username is in the /etc/crontab file.

    – Terrance
    yesterday











  • @Terrance that fixed my problem. i got my solution from cyberciti.biz/faq/… And I looked at the format and paid no attention to the "for system jobs"

    – caleb baker
    yesterday


















2















I am looking at the failure output of my crontab.



* * * * * user /usr/bin/python3 /home/user/src/code/prod.py


I get the error /bin/sh: 1: caleb: not found.



This corresponds to



X-Cron-Env: <SHELL=/bin/sh>


which is part of the email the crontab sent me. I created the crontab using



crontab -e


All of it looks like a simple setup is there anything that I am missing?










share|improve this question









New contributor




caleb baker is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.















  • 3





    When you run crontab -e it is already using your username so there is no need to add your username to the beginning of the command. The only place on the system that you add the username is in the /etc/crontab file.

    – Terrance
    yesterday











  • @Terrance that fixed my problem. i got my solution from cyberciti.biz/faq/… And I looked at the format and paid no attention to the "for system jobs"

    – caleb baker
    yesterday














2












2








2








I am looking at the failure output of my crontab.



* * * * * user /usr/bin/python3 /home/user/src/code/prod.py


I get the error /bin/sh: 1: caleb: not found.



This corresponds to



X-Cron-Env: <SHELL=/bin/sh>


which is part of the email the crontab sent me. I created the crontab using



crontab -e


All of it looks like a simple setup is there anything that I am missing?










share|improve this question









New contributor




caleb baker is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












I am looking at the failure output of my crontab.



* * * * * user /usr/bin/python3 /home/user/src/code/prod.py


I get the error /bin/sh: 1: caleb: not found.



This corresponds to



X-Cron-Env: <SHELL=/bin/sh>


which is part of the email the crontab sent me. I created the crontab using



crontab -e


All of it looks like a simple setup is there anything that I am missing?







16.04 cron






share|improve this question









New contributor




caleb baker is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




caleb baker is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited yesterday









Community

1




1






New contributor




caleb baker is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked yesterday









caleb bakercaleb baker

132




132




New contributor




caleb baker is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





caleb baker is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






caleb baker is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







  • 3





    When you run crontab -e it is already using your username so there is no need to add your username to the beginning of the command. The only place on the system that you add the username is in the /etc/crontab file.

    – Terrance
    yesterday











  • @Terrance that fixed my problem. i got my solution from cyberciti.biz/faq/… And I looked at the format and paid no attention to the "for system jobs"

    – caleb baker
    yesterday













  • 3





    When you run crontab -e it is already using your username so there is no need to add your username to the beginning of the command. The only place on the system that you add the username is in the /etc/crontab file.

    – Terrance
    yesterday











  • @Terrance that fixed my problem. i got my solution from cyberciti.biz/faq/… And I looked at the format and paid no attention to the "for system jobs"

    – caleb baker
    yesterday








3




3





When you run crontab -e it is already using your username so there is no need to add your username to the beginning of the command. The only place on the system that you add the username is in the /etc/crontab file.

– Terrance
yesterday





When you run crontab -e it is already using your username so there is no need to add your username to the beginning of the command. The only place on the system that you add the username is in the /etc/crontab file.

– Terrance
yesterday













@Terrance that fixed my problem. i got my solution from cyberciti.biz/faq/… And I looked at the format and paid no attention to the "for system jobs"

– caleb baker
yesterday






@Terrance that fixed my problem. i got my solution from cyberciti.biz/faq/… And I looked at the format and paid no attention to the "for system jobs"

– caleb baker
yesterday











1 Answer
1






active

oldest

votes


















5














If you are using crontab -e that set of Cron tasks runs as the user which crontab -e was executed as - that is, your user user.



Therefore, you should only provide the cron entry WITHOUT the user bits, i.e.:



* * * * * /usr/bin/python3 /home/user/src/code/prod.py


The user definition you were attempting to use should only be used in the system crontab in /etc/crontab and in entries in cron definitions under /etc/cron.d/.






share|improve this answer

























  • Not to nitpick, but the "cron user" probably has /usr/bin in its $PATH. So, * * * * * python3 /home/user/src/code/prod.py will probably work.

    – Seamus
    yesterday






  • 2





    @Seamus when using crontabs it's generally better to use full paths just to rule out that problem.

    – Thomas Ward
    yesterday











  • It's redundant... but I suppose that could be considered "generally better", for some. I'm only trying to point out that the "cron user" does have an environment, and it can be determined if it's not known.

    – Seamus
    yesterday







  • 1





    @Seamus I often have to explain to people why their jobs that run fine from a bash prompt don't work correctly under cron (or Autosys etc.). I tell them that it's best to use the full path to everything they can, and explicitly set PATH= what they want it to be, rather than rely on "probably".

    – Monty Harder
    yesterday











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);






caleb baker is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1131213%2fcrontab-fails-because-shell-path-not-found%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









5














If you are using crontab -e that set of Cron tasks runs as the user which crontab -e was executed as - that is, your user user.



Therefore, you should only provide the cron entry WITHOUT the user bits, i.e.:



* * * * * /usr/bin/python3 /home/user/src/code/prod.py


The user definition you were attempting to use should only be used in the system crontab in /etc/crontab and in entries in cron definitions under /etc/cron.d/.






share|improve this answer

























  • Not to nitpick, but the "cron user" probably has /usr/bin in its $PATH. So, * * * * * python3 /home/user/src/code/prod.py will probably work.

    – Seamus
    yesterday






  • 2





    @Seamus when using crontabs it's generally better to use full paths just to rule out that problem.

    – Thomas Ward
    yesterday











  • It's redundant... but I suppose that could be considered "generally better", for some. I'm only trying to point out that the "cron user" does have an environment, and it can be determined if it's not known.

    – Seamus
    yesterday







  • 1





    @Seamus I often have to explain to people why their jobs that run fine from a bash prompt don't work correctly under cron (or Autosys etc.). I tell them that it's best to use the full path to everything they can, and explicitly set PATH= what they want it to be, rather than rely on "probably".

    – Monty Harder
    yesterday















5














If you are using crontab -e that set of Cron tasks runs as the user which crontab -e was executed as - that is, your user user.



Therefore, you should only provide the cron entry WITHOUT the user bits, i.e.:



* * * * * /usr/bin/python3 /home/user/src/code/prod.py


The user definition you were attempting to use should only be used in the system crontab in /etc/crontab and in entries in cron definitions under /etc/cron.d/.






share|improve this answer

























  • Not to nitpick, but the "cron user" probably has /usr/bin in its $PATH. So, * * * * * python3 /home/user/src/code/prod.py will probably work.

    – Seamus
    yesterday






  • 2





    @Seamus when using crontabs it's generally better to use full paths just to rule out that problem.

    – Thomas Ward
    yesterday











  • It's redundant... but I suppose that could be considered "generally better", for some. I'm only trying to point out that the "cron user" does have an environment, and it can be determined if it's not known.

    – Seamus
    yesterday







  • 1





    @Seamus I often have to explain to people why their jobs that run fine from a bash prompt don't work correctly under cron (or Autosys etc.). I tell them that it's best to use the full path to everything they can, and explicitly set PATH= what they want it to be, rather than rely on "probably".

    – Monty Harder
    yesterday













5












5








5







If you are using crontab -e that set of Cron tasks runs as the user which crontab -e was executed as - that is, your user user.



Therefore, you should only provide the cron entry WITHOUT the user bits, i.e.:



* * * * * /usr/bin/python3 /home/user/src/code/prod.py


The user definition you were attempting to use should only be used in the system crontab in /etc/crontab and in entries in cron definitions under /etc/cron.d/.






share|improve this answer















If you are using crontab -e that set of Cron tasks runs as the user which crontab -e was executed as - that is, your user user.



Therefore, you should only provide the cron entry WITHOUT the user bits, i.e.:



* * * * * /usr/bin/python3 /home/user/src/code/prod.py


The user definition you were attempting to use should only be used in the system crontab in /etc/crontab and in entries in cron definitions under /etc/cron.d/.







share|improve this answer














share|improve this answer



share|improve this answer








edited yesterday

























answered yesterday









Thomas WardThomas Ward

45.1k23125178




45.1k23125178












  • Not to nitpick, but the "cron user" probably has /usr/bin in its $PATH. So, * * * * * python3 /home/user/src/code/prod.py will probably work.

    – Seamus
    yesterday






  • 2





    @Seamus when using crontabs it's generally better to use full paths just to rule out that problem.

    – Thomas Ward
    yesterday











  • It's redundant... but I suppose that could be considered "generally better", for some. I'm only trying to point out that the "cron user" does have an environment, and it can be determined if it's not known.

    – Seamus
    yesterday







  • 1





    @Seamus I often have to explain to people why their jobs that run fine from a bash prompt don't work correctly under cron (or Autosys etc.). I tell them that it's best to use the full path to everything they can, and explicitly set PATH= what they want it to be, rather than rely on "probably".

    – Monty Harder
    yesterday

















  • Not to nitpick, but the "cron user" probably has /usr/bin in its $PATH. So, * * * * * python3 /home/user/src/code/prod.py will probably work.

    – Seamus
    yesterday






  • 2





    @Seamus when using crontabs it's generally better to use full paths just to rule out that problem.

    – Thomas Ward
    yesterday











  • It's redundant... but I suppose that could be considered "generally better", for some. I'm only trying to point out that the "cron user" does have an environment, and it can be determined if it's not known.

    – Seamus
    yesterday







  • 1





    @Seamus I often have to explain to people why their jobs that run fine from a bash prompt don't work correctly under cron (or Autosys etc.). I tell them that it's best to use the full path to everything they can, and explicitly set PATH= what they want it to be, rather than rely on "probably".

    – Monty Harder
    yesterday
















Not to nitpick, but the "cron user" probably has /usr/bin in its $PATH. So, * * * * * python3 /home/user/src/code/prod.py will probably work.

– Seamus
yesterday





Not to nitpick, but the "cron user" probably has /usr/bin in its $PATH. So, * * * * * python3 /home/user/src/code/prod.py will probably work.

– Seamus
yesterday




2




2





@Seamus when using crontabs it's generally better to use full paths just to rule out that problem.

– Thomas Ward
yesterday





@Seamus when using crontabs it's generally better to use full paths just to rule out that problem.

– Thomas Ward
yesterday













It's redundant... but I suppose that could be considered "generally better", for some. I'm only trying to point out that the "cron user" does have an environment, and it can be determined if it's not known.

– Seamus
yesterday






It's redundant... but I suppose that could be considered "generally better", for some. I'm only trying to point out that the "cron user" does have an environment, and it can be determined if it's not known.

– Seamus
yesterday





1




1





@Seamus I often have to explain to people why their jobs that run fine from a bash prompt don't work correctly under cron (or Autosys etc.). I tell them that it's best to use the full path to everything they can, and explicitly set PATH= what they want it to be, rather than rely on "probably".

– Monty Harder
yesterday





@Seamus I often have to explain to people why their jobs that run fine from a bash prompt don't work correctly under cron (or Autosys etc.). I tell them that it's best to use the full path to everything they can, and explicitly set PATH= what they want it to be, rather than rely on "probably".

– Monty Harder
yesterday










caleb baker is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















caleb baker is a new contributor. Be nice, and check out our Code of Conduct.












caleb baker is a new contributor. Be nice, and check out our Code of Conduct.











caleb baker is a new contributor. Be nice, and check out our Code of Conduct.














Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1131213%2fcrontab-fails-because-shell-path-not-found%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form