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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

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