title: Write to a file until it reaches a certain size, then start new file
body: <p>I am using the command line tool <a href="https://github.com/DocNow/twarc" rel="nofollow noreferrer">twarc</a> to download Twitter data as a csv. I have set up my twarc commands and they successfully execute on the command line without issue. Example command:</p>
  <p><code>twarc dosomething &gt; outputfile.jsonl</code></p>
  <p>While I would like to carry out a collection process over an extended period of time, the output files become a bit too large (10+GB) after running for more than a day.</p>
  <p>I would like to run a bash script that executes the twarc command, runs until the output file reaches a certain limit, and then starts a new file.</p>
  <p>These questions are related...</p>
  <ul>
  <li><a href="https://stackoverflow.com/questions/12739416/when-file-reaches-certain-size-add-data-to-new-file">When file reaches certain size add data to new file</a></li>
  <li><a href="https://stackoverflow.com/questions/41511936/write-to-a-file-until-it-reaches-a-certain-size">Write to a file until it reaches a certain size</a></li>
  </ul>
  <p>...although I've had little luck with the translation.</p>
  <p>Could anyone provide some insight on setting up a basic bash script to execute a command, wait until a file grows to X size, and then start again on a new file? Could take it from there...</p>