Artificial intelligent assistant

How do I run a shell script which runs another script with cron? Whenn I run sh /opt/script/cypress.sh Everything works, the script changes directory and executes a command to open another script. But when I have my crontab like this 1 * * * * /opt/script/cypress.sh It doesn't work. I edited the crontab with "crontab -e" and tested if it works with a touch command The cypress.sh looks like: #!/bin/sh cd "/opt/script" | ./cypress > /opt/script/log; And the cypress file looks like: cd "/opt/Website Testing/" npx cypress run --record --key * I replaced the record key with "*" for this post

What worked for me is the following configuration:

crontab:


0 4 * * * /opt/script/cypress.sh > /opt/log


cypress.sh:


#!/bin/sh
. $HOME/.bashrc
cd "/opt/Website Testing/" && "/opt/Website Testing/node_modules/.bin/cypress" run --record --key *


Thanks for your help, the ". $HOME/.bashrc" was missing for me.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 0e323f1fc04b42758b44b6f3c0cacf78