Unable to execute a script at boot-up

Hello folks!

I created a simple script as shown below, and named it “keyboard_backlight.sh

echo '3-12' |sudo tee /sys/bus/usb/drivers/usb/unbind

To give executable permissions, I executed the command below.

sudo chmod 775 keyboard_backlight.sh

In order to execute the script (keyboard_backlight.sh) at boot-up, I ran the command below.

crontab -e

And entered the command below in crontab

@reboot /home/bizdik/keyboard_backlight.sh

But the script (keyboard_backlight.sh) doesn’t get executed at boot-up. When I manually execute the script in terminal, it works fine! I don’t understand why it doesn’t work at boot-up. Any idea?

Doesn’t crontab in Manjaro support “@reboot” entry (function)? Just wondering!!?

Any help is greatly appreciated! Thank you!

It’s been a long time since I used crontab. Perhaps a systemd service would suffice.

# /etc/systemd/system/keyboard-backlight.service
Description=Run keyboard_backlight.sh



The script will not need sudo, and should be put in /usr/local/bin, if you put it elsewhere then change the path in the service file.

echo '3-12' > /sys/bus/usb/drivers/usb/unbind

Then enable it.

sudo systemctl enable keyboard-backlight.service


/home may not be mounted yet by the time the script is run, so perhaps just put the script in a sensible place, such as /usr/local/bin.


1 Like

Thank you so much for your help, dmt! The systemd service did the trick! Thank you for the service file and also for making things so easy to understand.

After a long struggle and months of research, the keyboard backlight of my laptop (MSI GS76) finally works with Manjaro! And with your help, I was able to run the script at boot-up to automatically turn on the keyboard backlight.


1 Like

You’re welcome, glad I could help. :smile:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.