I am trying to run sell script just one time when the Linux start. I am not sure whether I should use cron job as I dont want to run the script more than one time.
On Mon, 17 Mar 2014 17:36:01 +0000, hpatel18 wrote:
> Hello Expert,
>
> I am trying to run sell script just one time when the Linux start. I am
> not sure whether I should use cron job as I dont want to run the script
> more than one time.
One time ever, or one time per boot?
If one time per boot, then @reboot is, as I recall, the keyword you
need. See ‘man 5 crontab’.
Other options would be to create a service file to run it, or use an ‘at’
job.
On Mon, 17 Mar 2014 18:26:01 +0000, hpatel18 wrote:
> I just want to run “one time ever” and not the “one time per boot”.
> sorry for the confusion.
You could just run it from a terminal window, then - unless it’s part of
a deployment process you’re using. What’s the purpose of the script in
question?
You could get fancy and create a service file that deletes itself when
the script has run, but if you just need to run it once when the system
boots
On Mon, 17 Mar 2014 19:06:02 +0000, hpatel18 wrote:
> Hi Jim,
>
> I have created a VM for my developers and that script has some commands
> which change some configuration in the software license.
I see - pretty much what I guessed, then - part of a deployment process.
Maybe take a look at the openSUSE “firstboot” script to see how that’s
done - I seem to remember that it cleans itself up so it only runs once
as well, seems like a good fit for what you’re trying to accomplish.
On 2014-03-17 23:29, Jim Henderson wrote:
> On Mon, 17 Mar 2014 19:06:02 +0000, hpatel18 wrote:
>
>> Hi Jim,
>>
>> I have created a VM for my developers and that script has some commands
>> which change some configuration in the software license.
>
> I see - pretty much what I guessed, then - part of a deployment process.
Er… this is the howto submission forum. No questions
–
Cheers / Saludos,
Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)
I’ve been looking at solutions for this for awhile now.
Basically, you should be looking at deployment managers to implement this kind of thing.
So, if you’re <really small> eg maybe <20 machines?
Vagrant is one of the most popular VM managers that fully manage practically all aspects of deployment… from managing your “golden” templates to scripting just about every aspect customizing a new Guest.
If you’re bigger, then you should be implementing Puppet or Chef which unlike Vagrant which is all scripts, you deploy Server(s) to manage not only the initial deployment but almost every maintenance aspect of your machines thereafter.
Unix is not a scripting language ;), although it is a century old post lol!.
Another one of the examples on the interwebs i.e. the shebang is kornshell and you will run it as