Running bash script after reboot

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
0
down vote

favorite












I would like to run the following script after reboot



username$ screen

username$ while true; do php cron.php; sleep 5; done


Then i'll create another screen session to run another one



username$ while true; do php cron2.php; sleep 5; done


usually I use cron to do that, but I want to do that every 5 seconds.



is there anyway to do even after the system reboot?










share|improve this question























  • The cron entry for at startup would be @reboot /path/to/script
    – Terrance
    Mar 20 at 4:26











  • What is $username?
    – wjandrea
    Mar 20 at 4:29










  • Sorry I meant to type username$
    – JackSmith
    Mar 20 at 5:15










  • @Terrance I'm not using cron!!
    – JackSmith
    Mar 20 at 5:16






  • 1




    OK, so you would just add that to your startup is all. I don't see anything complicated with what you're doing. By the way, the @reboot when added to the cron only runs at startup and never again until the next reboot.
    – Terrance
    Mar 20 at 5:22














up vote
0
down vote

favorite












I would like to run the following script after reboot



username$ screen

username$ while true; do php cron.php; sleep 5; done


Then i'll create another screen session to run another one



username$ while true; do php cron2.php; sleep 5; done


usually I use cron to do that, but I want to do that every 5 seconds.



is there anyway to do even after the system reboot?










share|improve this question























  • The cron entry for at startup would be @reboot /path/to/script
    – Terrance
    Mar 20 at 4:26











  • What is $username?
    – wjandrea
    Mar 20 at 4:29










  • Sorry I meant to type username$
    – JackSmith
    Mar 20 at 5:15










  • @Terrance I'm not using cron!!
    – JackSmith
    Mar 20 at 5:16






  • 1




    OK, so you would just add that to your startup is all. I don't see anything complicated with what you're doing. By the way, the @reboot when added to the cron only runs at startup and never again until the next reboot.
    – Terrance
    Mar 20 at 5:22












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I would like to run the following script after reboot



username$ screen

username$ while true; do php cron.php; sleep 5; done


Then i'll create another screen session to run another one



username$ while true; do php cron2.php; sleep 5; done


usually I use cron to do that, but I want to do that every 5 seconds.



is there anyway to do even after the system reboot?










share|improve this question















I would like to run the following script after reboot



username$ screen

username$ while true; do php cron.php; sleep 5; done


Then i'll create another screen session to run another one



username$ while true; do php cron2.php; sleep 5; done


usually I use cron to do that, but I want to do that every 5 seconds.



is there anyway to do even after the system reboot?







bash cron reboot






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 20 at 5:15

























asked Mar 20 at 4:07









JackSmith

11




11











  • The cron entry for at startup would be @reboot /path/to/script
    – Terrance
    Mar 20 at 4:26











  • What is $username?
    – wjandrea
    Mar 20 at 4:29










  • Sorry I meant to type username$
    – JackSmith
    Mar 20 at 5:15










  • @Terrance I'm not using cron!!
    – JackSmith
    Mar 20 at 5:16






  • 1




    OK, so you would just add that to your startup is all. I don't see anything complicated with what you're doing. By the way, the @reboot when added to the cron only runs at startup and never again until the next reboot.
    – Terrance
    Mar 20 at 5:22
















  • The cron entry for at startup would be @reboot /path/to/script
    – Terrance
    Mar 20 at 4:26











  • What is $username?
    – wjandrea
    Mar 20 at 4:29










  • Sorry I meant to type username$
    – JackSmith
    Mar 20 at 5:15










  • @Terrance I'm not using cron!!
    – JackSmith
    Mar 20 at 5:16






  • 1




    OK, so you would just add that to your startup is all. I don't see anything complicated with what you're doing. By the way, the @reboot when added to the cron only runs at startup and never again until the next reboot.
    – Terrance
    Mar 20 at 5:22















The cron entry for at startup would be @reboot /path/to/script
– Terrance
Mar 20 at 4:26





The cron entry for at startup would be @reboot /path/to/script
– Terrance
Mar 20 at 4:26













What is $username?
– wjandrea
Mar 20 at 4:29




What is $username?
– wjandrea
Mar 20 at 4:29












Sorry I meant to type username$
– JackSmith
Mar 20 at 5:15




Sorry I meant to type username$
– JackSmith
Mar 20 at 5:15












@Terrance I'm not using cron!!
– JackSmith
Mar 20 at 5:16




@Terrance I'm not using cron!!
– JackSmith
Mar 20 at 5:16




1




1




OK, so you would just add that to your startup is all. I don't see anything complicated with what you're doing. By the way, the @reboot when added to the cron only runs at startup and never again until the next reboot.
– Terrance
Mar 20 at 5:22




OK, so you would just add that to your startup is all. I don't see anything complicated with what you're doing. By the way, the @reboot when added to the cron only runs at startup and never again until the next reboot.
– Terrance
Mar 20 at 5:22















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1017497%2frunning-bash-script-after-reboot%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1017497%2frunning-bash-script-after-reboot%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

pylint3 and pip3 broken

Missing snmpget and snmpwalk

How to enroll fingerprints to Ubuntu 17.10 with VFS491