curlcronodroidarmbian

-bash: syntax error near unexpected token `crontab'


I am running Armbian 20.11.3 Buster v5.4.83 Minimal in an Odroid HC1.

The site freemyip.com offers free DDNS and doesn't need a client to update the DDNS. Instead, you set up your server to run a command as a cronjob. Once the server visits the specific URL, the DDNS gets updated.

The site's instructions say that there is a specific syntax for the command I need to run to update the DDNS. You can read the instructions here, at the section saying "If you have an always-on Linux on your network (or Raspbian on Raspberry Pi),"

So I am trying to run the command to make Armbian visit a specific URL every 20 minutes. The command is:

sudo (crontab -l;echo "*/19 * * * * curl \"https://freemyip.com/update?token=12345678901234567890123456789&domain=domain_name_here.freemyip.com\">/dev/null 2>&1")|crontab -

But when I try to run the command, I get the error:

-bash: syntax error near unexpected token `crontab'

Can someone help me figure out what I am doing wrong?


Solution

  • Your problem is that you are using the sudo command in front of it. Remove it, and it will work just fine.