Find the answer to your Linux question:
Results 1 to 2 of 2
Hello, I'm running into a formatting issue in my shell script basically I want to ssh into another server and run the following command: /usr/bin/printf "[%lu] DISABLE_HOST_SVC_CHECKS;app.test.com\n" `date +%s` > ...
  1. #1
    Just Joined!
    Join Date
    Apr 2009
    Posts
    15

    SSH formatting command

    Hello,

    I'm running into a formatting issue in my shell script basically I want to ssh into another server and run the following command:

    /usr/bin/printf "[%lu] DISABLE_HOST_SVC_CHECKS;app.test.com\n" `date +%s` > /usr/local/nagios3.0/var/rw/nagios.cmd


    I've tried using the ` ` and ' ' formatting but I can't get it right. Can anyone please help me out?


    ssh -l user test.server.com `/usr/bin/printf "[%lu] DISABLE_HOST_SVC_CHECKS;app.test.com\n" `date +%s` > /usr/local/nagios3.0/var/rw/nagios.cmd`

    Thanks,
    Nick

  2. #2
    Just Joined!
    Join Date
    Apr 2009
    Posts
    15
    Fixed the line:

    ssh -l user test.server.com "/usr/bin/printf '[%lu] DISABLE_HOST_SVC_CHECK;app.test.com\n' `date +%s` > /usr/local/nagios3.0/var/rw/nagios.cmd"

Posting Permissions

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