Is there any config file that is evaluated once, everytime operating system starts up. bashrc does not qualifies since it gets evaluated everytime a gnome terminal starts..
There are 2 places I use when I need to add "run-once" commands:
Once at every user login (be it Graphical/GDM or text/console login):
Once when GDM starts (before any user logs in):
Use the method that suits your need.
cron can be of help here.
Besides starting something on a minute,hour,day of week, month etc it also has some special operations:
@reboot Run once, at startup. @yearly Run once a year, "0 0 1 1 *". @annually (same as @yearly) @monthly Run once a month, "0 0 1 * *". @weekly Run once a week, "0 0 * * 0". @daily Run once a day, "0 0 * * *". @midnight (same as @daily) @hourly Run once an hour, "0 * * * *".
Editing is done from command line with the following command:
at the bottom of the file (below the
Just one warning: you need to make sure that there is no output from that script or that the output is redirected to a file (or /dev/null) since there is no display for cron to send the output (and it will end the operation).
# For more information see the manual pages of crontab(5) and cron(8) # PATH=/usr/sbin:/usr/bin:/sbin:/bin # m h dom mon dow command @reboot /usr/bin/testscript
cd /usr/bin/ sudo vi testscript echo "works" >/tmp/testing chmod 775 testscript
Now for a reboot... And here is a working example:
ls -l /tmp/testing -rw-r--r-- 1 root root 6 2011-05-29 08:34 /tmp/testing rinzwind@discworld:/tmp$ more /tmp/testing works
|show 2 more comments|
Have you looked into cron jobs? You can set one at reboot
Beside other answers, you can put your startup (superuser) commands in