Reputation
213
Top tag
Next privilege 250 Rep.
View close votes
Badges
2 3 12
Impact
~25k people reached

  • 0 posts edited
  • 0 helpful flags
  • 33 votes cast
Jun
9
revised Linux: Schedule command to run once after reboot (RunOnce equivalent)
consistency
Jun
9
comment Linux: Schedule command to run once after reboot (RunOnce equivalent)
@Dennis: Done. The patterns could probably be better, but it works for me.
Jun
9
revised Linux: Schedule command to run once after reboot (RunOnce equivalent)
only removed auto-generated comments now
Jun
9
comment Linux: Schedule command to run once after reboot (RunOnce equivalent)
@Dennis: Thanks. I originally didn't have that extra grep call in there, but all of the comments were piling up; three for every time I ran the script. I think I'll change the script to just always remove comment lines that look like those three auto-generated comments.
Jun
9
revised Linux: Schedule command to run once after reboot (RunOnce equivalent)
Forgot to update the output example with $RANDOM
Jun
9
revised Linux: Schedule command to run once after reboot (RunOnce equivalent)
Moved output script removal from output script to runonce script
Jun
9
revised Linux: Schedule command to run once after reboot (RunOnce equivalent)
Added script basename and $RANDOM to temp crontab file to help avoid accidentally overwriting and deleting someone else's file.
Jun
9
revised Linux: Schedule command to run once after reboot (RunOnce equivalent)
sudo example
Jun
9
awarded  Teacher
Jun
9
revised Linux: Schedule command to run once after reboot (RunOnce equivalent)
added 402 characters in body; added 13 characters in body; added 6 characters in body
Jun
9
revised Linux: Schedule command to run once after reboot (RunOnce equivalent)
added 62 characters in body
Jun
9
revised Linux: Schedule command to run once after reboot (RunOnce equivalent)
Replaced output script prefix with name of runonce script; if runonce script is named fhqwhgads, then running the command "fhqwhgads foo" will produce an output script named ".fhqwhgads_foo".
Jun
9
revised Linux: Schedule command to run once after reboot (RunOnce equivalent)
Missed a set of backticks.
Jun
9
awarded  Scholar
Jun
9
accepted Linux: Schedule command to run once after reboot (RunOnce equivalent)
Jun
9
revised Linux: Schedule command to run once after reboot (RunOnce equivalent)
Replaced backticks (``) with $(). See http://mywiki.wooledge.org/BashFAQ/082
Jun
9
awarded  Editor
Jun
9
revised Linux: Schedule command to run once after reboot (RunOnce equivalent)
added 61 characters in body
Jun
9
answered Linux: Schedule command to run once after reboot (RunOnce equivalent)
Jun
9
comment Linux: Schedule command to run once after reboot (RunOnce equivalent)
Thanks for your answer. This solution is great. It technically solves my problem, however it seems like there's a lot of preparation of infrastructure required to make this work. It's not portable. I think your solution would ideally be baked into a Linux distribution (I'm not sure why it isn't!). Your answer inspired my ultimate solution, which I've also posted as an answer. Thanks again!