Answer the question
In order to leave comments, you need to log in
Why is the command not working in cron?
Good afternoon.
There is ubuntu 20.04, in the root crontab (sudo crontab -e) added:
@reboot echo 60 > /sys/class/power_supply/BAT0/charge_control_end_threshold
echo 60 | sudo tee /sys/class/power_supply/BAT0/charge_control_end_threshold
then the changes will be applied. Strange, but I remember that I noticed this with other commands, perhaps during the '@reboot' hook the system is not fully initialized, or something like that. Who faced this, tell me the reasons Answer the question
In order to leave comments, you need to log in
maybe during the '@reboot' hook the system is not fully initialized,
There is no PATH in the cron.
Write the full paths to any command that you have "and manually executed."
Because it is necessary to reload Cron:
sudo /etc/init.d/cron restart
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question