I have created a executable bash script (using chmod +x) for monitoring my system and it works perfectly with out any error. Now i want to add this script on my start up in order to executing the script on every reboot. I have saved this executable file in my documents folder like this
/home/user/Documents/file.sh
For running this script on start up; from dash i searched and selected "Startup Applications" and added the details and location of the script and done a fresh reboot. But even after a fresh reboot the script is not working but the script is executing when i do it with terminal (eg ./file.sh
). What changes should i make it to run my script on start up. If it helps this is the attribute of my script
-rwxrwxr-x ;using ls -l
One more option is schedule a job at boot time
Choose an editor to open the cron job file. Append the following with your script name
In your case
Make sure the script has executable permission.
So I have succesfully run the script using my method itself (System > Preferences > Startup Applications). These are the changes I made to my script.
Added this line at the top of my script
Then made executable using this command
rebooted the system
In addition to what Eka says, make sure your
.desktop
file, in~/.config/autostart/
, contains the following lines:This did the trick to me.