how to run script in linux at startup
crontab -e // To make a crontab file
@reboot *your shell command here* // to run at startup
how to run script in linux at startup
crontab -e // To make a crontab file
@reboot *your shell command here* // to run at startup
start scipt at startup ubuntu
Create a systemd unit file with .service extension in /etc/systemd/system,
for example creating:
sudo nano /etc/systemd/system/my-service.service
, with the following content:
[Unit]
Description=My custom startup script
[Service]
ExecStart=/home/user/startup.sh start
[Install]
WantedBy=multi-user.target
You can now start/stop this service with:
sudo systemctl start my-service / sudo systemctl stop my-service
To enable this service when startup, run:
sudo systemctl enable my-service
To disable this service when startup, run:
sudo systemctl disable my-service
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us