$ script-in-script.sh > /dev/shm/output.txt; works fine.
But, if you put the above command line in script.sh
and add
* * * * * script.sh
in crontab -e it doesn't work. /dev/shm/output.txt is created anyway but empty.
How can I make it work in crontab -e
?
PS: script-in-script.sh
and script.sh
both are executable.
:script-in-script.sh
#!/bin/bash
echo "This Text";
:script.sh
#!/bin/bash
script-in-script.sh > /dev/shm/output.txt;
Add full path to all commands
And also add path to
script-in-script.sh
.PATH doesn't work in crontabs.