Answer the question
In order to leave comments, you need to log in
Cron on hosting stops for some reason?
If you run the script through the terminal, then it will work to the end, and if through Cron, it will be interrupted. What to do? Maybe there are some settings on the hosting?
Answer the question
In order to leave comments, you need to log in
Contact the hoster, because any task (as a rule) is not limited in execution time. For example php, by default it is not limited to execution (cli), so I advise you to contact the hoster.
Most likely, the fact is that processes launched from cron and tasks launched from shell have a different context - a different set of system variables ( in cron - much less ).
As already answered above, Cron has a different set of system variables.
What can I advise?
1. At a minimum, set all commands that are executed in the script (cp, rm, cat) to full paths (/bin/cp and so on). The full path can be found with the which command.
2. Keep logs. That is, output the result of each command to a file. It will help to debug and understand what is being executed and what is not.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question