1 1
Benny1982

daily reboot with cron

Recommended Posts

i would like to reboot my cubi every day at 3 o clock,

my linux experience is not so good.

 

can same one explain me how i can do it with cron,

because i have no clue with the cron.d/crone.daily etc.

Share this post


Link to post
Share on other sites
2 hours ago, Benny1982 said:

i would like to reboot my cubi every day at 3 o clock - can same one explain me how i can do it with cron

login as root and open/create your crontab with crontabe -e

and insert:

# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * command to be executed
* 3 * * * /sbin/shutdown -r now

then save the file (if you selected nano as editor then with Ctrl+O, Enter and Ctrl+X)

-r ist for reboot

Share this post


Link to post
Share on other sites
On 2/23/2018 at 9:57 AM, guidol said:

login as root and open/create your crontab with crontabe -e

and insert:


# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * command to be executed
* 3 * * * /sbin/shutdown -r now

then save the file (if you selected nano as editor then with Ctrl+O, Enter and Ctrl+X)

-r ist for reboot

 

And if I want to poweroff. Would it be the same but just using poweroff command?

I am using Armbian Stretch on OrangePI PC2.

I will program the OrangePi to poweroff before the smartplug to which is plugged in switch the power off too.

Then I expect to reboot remotely by turning the smartplug on.

 

Thanks.

Share this post


Link to post
Share on other sites
3 hours ago, usuario74 said:

And if I want to poweroff.  Would it be the same but just using poweroff command?

I am using Armbian Stretch on OrangePI PC2.

I will program the OrangePi to poweroff before the smartplug to which is plugged in switch the power off too.

Then I expect to reboot remotely by turning the smartplug on.

 

Yes - this will work :)
 

# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * command to be executed
* 3 * * * /sbin/poweroff

 

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.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   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...
1 1