krontab icon indicating copy to clipboard operation
krontab copied to clipboard

Handle passing command as a string

Open jacobtomlinson opened this issue 5 years ago • 0 comments

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 &gt; /tmp'

The string needs unwrapping to resolve this.

jacobtomlinson avatar Apr 10 '19 08:04 jacobtomlinson