I have a cron job set up to run boot.sh
on reboot, and log the input to debug.txt.
@reboot cd /home/<user>/code/seasons-pixel-clock/ && (sudo bash boot.sh) > debug.txt
The contents of boot.sh
are as follows:
cd /home/<user>/code/seasons-pixel-clock
sudo git fetch
sudo git pull
sudo python3 src/main.py
Now from the above, I would expect git pull and git fetch to occur on boot. However, neither occurs. Main.py
does execute, however. Moreover, no error is printed in debug.txt.
What is the correct way to git pull/fetch on boot?
debug.txt
? Why do you usesudo
with git?#! /bin/sh
? I'm not sure if it is absolutely necessary in this case, but might be a good idea to add it.main.py
is executed? Also, how aboutsudo
, is there a reason for you to use it with git? Can you addecho test
or betterecho $PWD
line in the script to check if it will appear in thedebug.txt
file?