Skip to main content
elaborating
Source Link
Jonathan
  • 775
  • 1
  • 7
  • 14

You may not be able to run source if the sh shell is being used. This can be changed by adding the following line in your crontab:

SHELL=/bin/bash * * * * * source "/root/.bashrc"; <command> 

You can also specify the environment:

BASH_ENV="/root/.bashrc" * * * * * <command> 

or you can use your local /home/user/.bashrc if it is a user cron job (e.g. crontab -e).

Note that .bash_profile can replace .bashrc, if it exists.

Credit: How to change cron shell (sh to bash)?

You may not be able to run source if the sh shell is being used. This can be changed by adding the following line in your crontab:

SHELL=/bin/bash 

You can also specify the environment:

BASH_ENV="/root/.bashrc" 

or your local .bashrc if it is a user cron job (e.g. crontab -e).

Credit: How to change cron shell (sh to bash)?

You may not be able to run source if the sh shell is being used. This can be changed by adding the following line in your crontab:

SHELL=/bin/bash * * * * * source "/root/.bashrc"; <command> 

You can also specify the environment:

BASH_ENV="/root/.bashrc" * * * * * <command> 

or you can use your local /home/user/.bashrc if it is a user cron job (e.g. crontab -e).

Note that .bash_profile can replace .bashrc, if it exists.

Credit: How to change cron shell (sh to bash)?

Source Link
Jonathan
  • 775
  • 1
  • 7
  • 14

You may not be able to run source if the sh shell is being used. This can be changed by adding the following line in your crontab:

SHELL=/bin/bash 

You can also specify the environment:

BASH_ENV="/root/.bashrc" 

or your local .bashrc if it is a user cron job (e.g. crontab -e).

Credit: How to change cron shell (sh to bash)?