Find the answer to your Linux question:
Results 1 to 4 of 4
I run tacacs on a FEDORA 10 box. We have mutiple TACACS servers and therefore I would like to run on one machine and that roll out the configs to ...
  1. #1
    Just Joined!
    Join Date
    Nov 2009
    Posts
    2

    Create a Cron Job which copys a file and restart a process.

    I run tacacs on a FEDORA 10 box.
    We have mutiple TACACS servers and therefore I would like to run on one machine and that roll out the configs to another.

    Here is my script so far, And manually the copy works.
    Here is the issue. The TACACS service starts on bootup via a CRON job, therefore is listed as a PID.

    My question is how do I make my script stop TACACs and reboot the service.

    I cannot do service TACACS restart

    . ~/root/.ssh-agent-info-`hostname` >/dev/null

    #####Copy Nagios QL Files#####

    scp -r /etc/tac_plus/* root at xxx.xxx.xxx.xxx:/etc/tac_plus/

    #####Restart TACACS#####

    Many thanks
    Lee

  2. #2
    Just Joined!
    Join Date
    Oct 2009
    Posts
    20
    You could try killall 9. I can't post links but google for "get a process pid" and click im feeling lucky

  3. #3
    Just Joined!
    Join Date
    Nov 2009
    Posts
    2
    Update.

    Here is my crontab e

    @hourly /etc/cron.hourly/NAGIOS
    @hourly /etc/cron.daily/TACACS


    Here are my CRON JOBS Below
    If run manually they work spot on. However the CRON is not running autmatically. How can I see why these are not working.

    NAGIOS

    ###############################################
    ###Nagios CRON Update####
    ###############################################

    #.~/root/.ssh-agent-info-`hostname` >/dev/null

    #####Copy Nagios QL Files#####

    scp -r /usr/local/nagios/etc/* root@10.1.1.60:/usr/local/nagios/etc/
    scp -r /etc/nagiosql/* root@10.1.1.60:/etc/nagiosql/

    #####Restart Nagios#####

    ssh 10.1.1.60 '/etc/rc.d/init.d/nagios restart'

    TACACS

    ######################################
    ###TACACS CONF FILE OVER NIGHT COPY###
    ######################################


    #####Copy TACACS#####

    scp -r /etc/tac_plus/* root@10.1.1.60:/etc/tac_plus/

    #####Restart TACACS#####

    ssh 10.1.1.60 'killall tac_plus'
    ssh 10.1.1.60 'tac_plus -C /etc/tac_plus/tac_plus.conf &'

  4. #4
    Just Joined!
    Join Date
    Oct 2009
    Posts
    20
    You could try MAILTO = "user@example.com"

    Also I like rsync over scp. Also scp for backups is bad, if you clear the contents of a local file it gets replicated on the other end. I like to use subversion for incremental stuff. Then you could just run 'svn update' on the backup server to copy only changes, while retaining full incremental history on the files. Can be used for binary files, .sql dumps, system files, etc..

Posting Permissions

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