How can I schedule a command to run the next time I log in? I don't want it to run every time, just once.
Asked
Active
Viewed 5,363 times
4
-
Add your command in /etc/rc.local ? – karthick87 Dec 28 '10 at 05:27
-
Similar to How to run scripts on start up of ubuntu? – Marco Ceppi Dec 28 '10 at 13:13
3 Answers
3
This is really "ugly" solution, but you can add classic logon/startup script and after first run remove this script automatically.
#!/bin/bash
your command &
rm /path/to/script/yourscript.sh
The script will be removed, so it can't be started again.
(I'm sure there's a bettter solution, but I don't know it.)

Vojtech Trefny
- 15,171
-
2This gets the job done. For insurance, I went with
mv "$0" /home/user/.old-scripts/
instead of rm. – ændrük Jan 19 '11 at 19:18
2
running a script has couple of options How to run scripts on start up?
I would try .gnomerc one, you can make it one time by making your script remove itself from .gnomerc once its done.
0
This is already covered on this very site : How to run scripts on start up?
The second answer down seems to be the cleanest solution.
-
1This question is about running it during the next log in only, not during every start of the system. – Olathe Jun 04 '13 at 14:26
-