+ Post New Thread
Results 1 to 9 of 9
*nix Thread, Scheduled Squid Restart in Technical; How do I schedule a Squid restart on NetBSD for example at 7:00am? Wes...
  1. #1
    wesleyw's Avatar
    Join Date
    Dec 2005
    Location
    Kingswinford
    Posts
    2,208
    Thank Post
    225
    Thanked 50 Times in 44 Posts
    Blog Entries
    1
    Rep Power
    30

    Scheduled Squid Restart

    How do I schedule a Squid restart on NetBSD for example at 7:00am?


    Wes

  2. #2

    dhicks's Avatar
    Join Date
    Aug 2005
    Location
    Knightsbridge
    Posts
    5,653
    Thank Post
    1,257
    Thanked 781 Times in 678 Posts
    Rep Power
    236
    Quote Originally Posted by wesleyw View Post
    How do I schedule a Squid restart on NetBSD for example at 7:00am?
    Just get cron to run "/etc/init.d/squid restart" at 7am every day.

    --
    David Hicks

  3. #3

    EduTech's Avatar
    Join Date
    Aug 2007
    Location
    Reading
    Posts
    5,068
    Thank Post
    160
    Thanked 925 Times in 727 Posts
    Blog Entries
    3
    Rep Power
    273
    You could set up a cron job run at some point in the day.

    command i believe is /etc/init.d/squid restart

    James.

    Edit: well it appears i was right, just too slow ... (thanks for confirming that though david)

    I cant test it, but if that command dont work try /etc/rc.d/init.d/squid restart
    Last edited by EduTech; 25th February 2009 at 10:21 AM.

  4. #4
    wesleyw's Avatar
    Join Date
    Dec 2005
    Location
    Kingswinford
    Posts
    2,208
    Thank Post
    225
    Thanked 50 Times in 44 Posts
    Blog Entries
    1
    Rep Power
    30
    Looks like mine is a little too Bespoke. /etc/init.d does exist for a start.


    Wes

  5. #5

    dhicks's Avatar
    Join Date
    Aug 2005
    Location
    Knightsbridge
    Posts
    5,653
    Thank Post
    1,257
    Thanked 781 Times in 678 Posts
    Rep Power
    236
    Quote Originally Posted by wesleyw View Post
    Looks like mine is a little too Bespoke. /etc/init.d does exist for a start.
    Woops, sorry, BSD - try /etc/rc.d instead?

    --
    David Hicks

  6. Thanks to dhicks from:

    wesleyw (25th February 2009)

  7. #6
    wesleyw's Avatar
    Join Date
    Dec 2005
    Location
    Kingswinford
    Posts
    2,208
    Thank Post
    225
    Thanked 50 Times in 44 Posts
    Blog Entries
    1
    Rep Power
    30
    Currently my cron looks like this:
    #
    # $NetBSD: cron,v 1.6 2004/08/13 18:08:03 mycroft Exp $
    #

    # PROVIDE: cron
    # REQUIRE: LOGIN
    # KEYWORD: shutdown

    $_rc_subr_loaded . /etc/rc.subr

    name="cron"
    rcvar=$name
    command="/usr/sbin/${name}"
    pidfile="/var/run/${name}.pid"

    load_rc_config $name
    run_rc_command "$1"



    Do you know where/what I have to do to add that in and get it to run at a specified time? Sorry I'm really now well versed in *nix


    Wes

  8. #7

    EduTech's Avatar
    Join Date
    Aug 2007
    Location
    Reading
    Posts
    5,068
    Thank Post
    160
    Thanked 925 Times in 727 Posts
    Blog Entries
    3
    Rep Power
    273
    Quote Originally Posted by EduTech View Post
    You could set up a cron job run at some point in the day.

    command i believe is /etc/init.d/squid restart

    James.

    Edit: well it appears i was right, just too slow ... (thanks for confirming that though david)

    I cant test it, but if that command dont work try /etc/rc.d/init.d/squid restart

    Wes dont you read you must sort your eye's out lol

    James.

  9. #8
    wesleyw's Avatar
    Join Date
    Dec 2005
    Location
    Kingswinford
    Posts
    2,208
    Thank Post
    225
    Thanked 50 Times in 44 Posts
    Blog Entries
    1
    Rep Power
    30
    No I meant how do you get the cron job to start up at at specified time?


    Wes

  10. #9

    dhicks's Avatar
    Join Date
    Aug 2005
    Location
    Knightsbridge
    Posts
    5,653
    Thank Post
    1,257
    Thanked 781 Times in 678 Posts
    Rep Power
    236
    Quote Originally Posted by wesleyw View Post
    how do you get the cron job to start up at at specified time?
    Handily cribbed from Webman's post to the "Backing up Zimbra" thread:

    To edit the cron schedual (do this as root user, or use sudo):

    crontab -e

    And add something along these lines to the end of the file:

    0 7 * * * /etc/rc.d/squid restart

    You might want to check the man page for the commands above - "man cron" and "man crontab" should get you all you need to know.

    --
    David Hicks
    Last edited by dhicks; 25th February 2009 at 01:59 PM.

  11. Thanks to dhicks from:

    wesleyw (25th February 2009)

SHARE:
+ Post New Thread

Similar Threads

  1. Server Restart
    By Gibson335 in forum Hardware
    Replies: 8
    Last Post: 23rd January 2009, 09:40 AM
  2. scheduled tasks
    By techie08 in forum Windows
    Replies: 0
    Last Post: 15th December 2008, 02:05 PM
  3. Scheduled WOL
    By m1ddy in forum Windows
    Replies: 12
    Last Post: 11th November 2008, 09:24 AM
  4. Restart Issue
    By JAW$ in forum Windows
    Replies: 1
    Last Post: 1st July 2008, 12:21 PM
  5. Looking for a little help with scheduled tasks
    By cromertech in forum Windows Vista
    Replies: 1
    Last Post: 8th February 2008, 04:28 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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