I'm not in front of a testing environment right now but I desire to download a Bash script with curl and then load its content into crontab.

The content as appears in Github raw document is for example:

0 0 * * * ... 
0 0 * * 0 ...

Is this code template looks okay to you?

curl -O https://raw.githubusercontent.com/user/repo/master/file.sh | crontab
  • You said curl by default outputs to stdout. I think I understand you: The pipe works on stdin therefor it will fail, right? Jan 12, 2018 at 18:08

1 Answer 1


curl outputs to stdout by default so

curl URL

is enough. And at least on macOS crontab needs a - to read from stdin so we end up with

curl URL | crontab -

Whether it is wise to load unverified data from an URL directly into Cron is another question though...

  • Thanks, the data is verified from my personal Github account. Jan 12, 2018 at 18:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .