203 reputation
311
bio website cparker15.com
location Boston, MA
age 31
visits member for 5 years, 2 months
seen May 21 at 17:55

“JavaScript jockey and Free software advocate”

FSF Associate Member #795
Join the FSF as an Associate Member!

Where I Am:

StackExchange Profiles:


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!
Jun
8
awarded  Supporter
Jun
4
awarded  Student
Jun
4
asked Linux: Schedule command to run once after reboot (RunOnce equivalent)