TRIGGERcmd
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    How to create a trigger

    Scheduled Pinned Locked Moved General Discussion
    3 Posts 2 Posters 1.3k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G Offline
      gigaboy
      last edited by

      I'm wanting to use this to restart mysqld using ifttt on a server that does NOT have a GUI.

      All the docs I'm reviewing state to launch a GUI to create the command.
      Nothing like that in the TriggerCMD interface.

      Take a look at this AI generated result from Google Search:
      https://www.google.com/search?q=how+to+trigger+a+mysql+restart+on+ubuntu+using+ifttt&oq=how+to+trigger+a+mysql+restart+on+ubuntu+using+ifttt&gs_lcrp=EgZjaHJvbWUyBggAEEUYOTIGCAEQLhhA0gEJMjIwMzdqMGoxqAIAsAIA&sourceid=chrome&ie=UTF-8

      RussR 1 Reply Last reply Reply Quote 0
      • RussR Offline
        Russ @gigaboy
        last edited by Russ

        @gigaboy, thanks for sharing that link. I'm loving the fact that Google gave you that answer - to use TRIGGERcmd via IFTTT.

        If your server doesn't have a GUI, you'll have to edit your ~/.TRIGGERcmdData/commands.json file manually, using a text editor like vi (aka vim) or pico, nano etc.

        On Linux, your default ~/.TRIGGERcmdData/commands.json file includes the first 5 commands. I added the 6th command you could use to restart mysql, like Google says.

        [
          {"trigger":"Reboot","command":"shutdown -r","ground":"background","voice":"reboot","allowParams": "false"},
          {"trigger":"Gnome Editor","command":"gedit","ground":"foreground","voice":"notepad","allowParams": "false"},
          {"trigger":"Calculator","command":"gnome-calculator","ground":"foreground","voice":"calculator","allowParams": "false"},
          {"trigger":"yum update","command":"yum -y update","ground":"background","voice":"yum update","allowParams": "false"},
          {"trigger":"apt update","command":"apt-get -y update","ground":"background","voice":"update","allowParams": "false"},
          {
            "trigger": "Restart MySQL",
            "command": "sudo systemctl restart mysql",
            "offCommand": "",
            "ground": "background",
            "voice": "restart",
            "voiceReply": "",
            "allowParams": "false"
          }
        ]
        

        Notice I made "ground" = "background" because without a GUI, you probably installed the background agent (with installdaemon.sh) which runs the TRIGGERcmd agent in background mode as service.

        Russell VanderMey

        G 1 Reply Last reply Reply Quote 0
        • G Offline
          gigaboy @Russ
          last edited by

          @Russ
          Perfect! Thanks for your help!

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post