krontab
krontab copied to clipboard
Handle passing command as a string
There are some caveats which need addressing around the krontab run job --command <command>
usage.
Currently if you try and pipe output or use logical operators to string multiple commands together they get executed locally.
# Pipes the output of the krontab command into /tmp/test.log on the local machine
krontab run job --command echo hello > /tmp/test.log
# Runs echo hello in job and then uptime locally
krontab run job --command echo hello && uptime
One solution to this would be to allow you to wrap the command in quotes. However this results in problems.
krontab run job --command 'echo hello > /tmp'
# Output of job is 'hello > /tmp'
The string needs unwrapping to resolve this.