Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 25

Thread: Scheduling Weekly Reboots

  1. #11
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: Scheduling Weekly Reboots

    Same command, just use the full path to it in the root crontab.
    On 16.04,
    Code:
    /usr/sbin/service plexmediaserver restart
    I've been able to avoid systemd stuff, but use the full path to the program.

  2. #12
    Join Date
    Mar 2018
    Beans
    29

    Re: Scheduling Weekly Reboots

    Quote Originally Posted by TheFu View Post
    Same command, just use the full path to it in the root crontab.
    On 16.04,
    Code:
    /usr/sbin/service plexmediaserver restart
    I've been able to avoid systemd stuff, but use the full path to the program.

    So to restart the service every Sunday at 2:30 AM it would be:
    Code:
    30 2  *    *    7 ]/usr/sbin/service plexmediaserver restart
    Correct?

    Thank you in advance!

  3. #13
    Join Date
    Apr 2014
    Beans
    550

    Re: Scheduling Weekly Reboots

    remove the ]

  4. #14
    Join Date
    Mar 2018
    Beans
    29

    Re: Scheduling Weekly Reboots

    Quote Originally Posted by Tadaen_Sylvermane View Post
    remove the ]
    So one question for you; what in the command tells it that it should be "Sunday" - the "7"?

  5. #15
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: Scheduling Weekly Reboots

    Code:
    # m h  dom mon dow   command
    # .---------------- 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
    # *  *  *  *  *  command --arg1 --arg2 file1 file2 2>&1
    Put that in the crontab that you edit using crontab -e as a reminder.

  6. #16
    Join Date
    Jan 2010
    Location
    Wheeling WV USA
    Beans
    1,466
    Distro
    Xubuntu 18.04 Bionic Beaver

    Re: Scheduling Weekly Reboots

    Quote Originally Posted by linuxnoob87 View Post
    Looking to reboot weekly as I'm running a Plex server and anything more than a week seems to prevent me from being able to SSH/Log into the system
    that's not the way things should work. i've left my server up for months and when i ssh in, all works fine, every time, just as it should.

    about the only trouble i have with a long running Linux is an overly cluttered page table or swap space the slows thing down. i like to reboot to a clean system when i run upgrades and reboot twice afterwards because some packages like to have some things finish after the next reboot. and that gets me onto the latest kernel the upgrade brought in. but i still do all that manually because there is no time i am regularly not using the laptop.
    What do you call someone who speaks 3 languages? Trilingual.
    What do you call someone who speaks 2 languages? Bilingual.
    What do you call someone who speaks 1 language? American.

  7. #17
    Join Date
    Jan 2010
    Location
    Wheeling WV USA
    Beans
    1,466
    Distro
    Xubuntu 18.04 Bionic Beaver

    Re: Scheduling Weekly Reboots

    Code:
    #       __________ Minute (0-59)
    #      / _________ Hour (0-23)
    #     / /  _______ Day Of Month (1-31)
    #    / /  /   ____ MONth (1-12) -OR- jan,feb,mar,apr,may,jun,jul,aug,sep,oct.nov,dec
    #   / /  /   /   _ Day Of Week (0-7) (Sun = 0 or 7) -OR- sun,mon,tue,wed,thu,fri,sat
    #  / /  /   /   /  -------------------------------------------------------------
    # m h dom mon dow  command  <arguments>  &>logfilename
    What do you call someone who speaks 3 languages? Trilingual.
    What do you call someone who speaks 2 languages? Bilingual.
    What do you call someone who speaks 1 language? American.

  8. #18
    Join Date
    Mar 2018
    Beans
    29

    Re: Scheduling Weekly Reboots

    Quote Originally Posted by Skaperen View Post
    that's not the way things should work. i've left my server up for months and when i ssh in, all works fine, every time, just as it should.

    about the only trouble i have with a long running Linux is an overly cluttered page table or swap space the slows thing down. i like to reboot to a clean system when i run upgrades and reboot twice afterwards because some packages like to have some things finish after the next reboot. and that gets me onto the latest kernel the upgrade brought in. but i still do all that manually because there is no time i am regularly not using the laptop.
    I know that if I don't reboot weekly (or so) that I can't SSH in. It's running in a VM with plenty of RAM and CPU. I'm hoping that weekly restarts of the Plex service will fix the issue.

  9. #19
    Join Date
    Mar 2018
    Beans
    29

    Re: Scheduling Weekly Reboots

    Quote Originally Posted by TheFu View Post
    Code:
    # m h  dom mon dow   command
    # .---------------- 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
    # *  *  *  *  *  command --arg1 --arg2 file1 file2 2>&1
    Put that in the crontab that you edit using crontab -e as a reminder.
    Done and thanks! I'll report back how it goes.

  10. #20
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: Scheduling Weekly Reboots

    Quote Originally Posted by linuxnoob87 View Post
    Done and thanks! I'll report back how it goes.
    Hope you realize those are just comments for reminders what each column means. Nothing more.

Page 2 of 3 FirstFirst 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •