Jump to content
  • 0
Sign in to follow this  
Zirius

Run a single line command on Debian upon startup?

Question

Hello! At is seems, my server's time is off by 4mins, now I have to run:

sudo ntpdate ntp.pagasa.dost.gov.ph

everytime I reboot, which sometimes I forgot to run, is there a way that command be run immediately after startup?

 

thanks!

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

my-super-script.sh

#!/bin/bash/usr/sbin/ntpdate ntp.pagasa.dost.gov.ph

put it into /etc/init.d folder:

 

mv my-super-script.sh /etc/init.d/ 

 

Set it executable:

 

chmod +x /etc/init.d/my-super-script.sh 

 

 

Create symlink to /etc/rc.d folder

 

ln -s /etc/init.d/my-super-script.sh /etc/rc.d/ 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.