I am getting a "-bash: syntax error near unexpected token `crontab'" when I am attempting to write a cron job to crontab in one line. (This is for a launch configuration on EC2.) I am following this guide here.
This is my command:
sudo { crontab -l -u ec2-user; echo "* * * * * touch /home/ec2-user/dummy/dummy$ENV"; } | crontab -u ec2-user -
If I run without sudo, it tells me I "must be privileged to use -u." When I run with sudo I get "bash: syntax error near unexpected token `}'"
I am sure I have my syntax wrong with the sudo, but I am not sure where.