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

How to create a trigger

General Discussion
2
3
135
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
    gigaboy
    last edited by Apr 12, 2025, 12:57 PM

    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

    R 1 Reply Last reply Apr 12, 2025, 9:29 PM Reply Quote 0
    • R
      Russ @gigaboy
      last edited by Russ Apr 12, 2025, 9:34 PM Apr 12, 2025, 9:29 PM

      @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 Apr 13, 2025, 5:31 PM Reply Quote 0
      • G
        gigaboy @Russ
        last edited by Apr 13, 2025, 5:31 PM

        @Russ
        Perfect! Thanks for your help!

        1 Reply Last reply Reply Quote 0
        3 out of 3
        • First post
          3/3
          Last post