Do curl bash and mockaroo get along? (they do, I'm an idiot)

I am using Curl to download sql data. There are two nearly identical schema which should return nearly identical results, the first Event(daily) works perfectly, but the second Event(weekly) is useless. The odd part is, valid data is produced when the Download Data button is pressed. This is the desired format, as produced by the Download Data button:

Good

insert into COMMON_USER.EVENT (ID, START_DAY, END_DATE, TITLE, DESCRIPTION, ALL_DAY, CALENDAR_ID, LOCATION, WEEK_MONTH, SOURCE_CALENDAR, RRULE, DURATION) values (DEFAULT, '2016-08-03T20:00:00-04:00', '2016-08-03T21:00:00-04:00', 'ENG CHALK TALK', null, 0, 3, 440, 1, 2, null, null);
insert into COMMON_USER.EVENT (ID, START_DAY, END_DATE, TITLE, DESCRIPTION, ALL_DAY, CALENDAR_ID, LOCATION, WEEK_MONTH, SOURCE_CALENDAR, RRULE, DURATION) values (DEFAULT, '2016-08-03T08:00:00-04:00', '2016-08-03T08:30:00-04:00', 'LOK Interviews (XO/ENG/EDMC)', null, 1, 3, 312, 1, 6, null, null);
insert into COMMON_USER.EVENT (ID, START_DAY, END_DATE, TITLE, DESCRIPTION, ALL_DAY, CALENDAR_ID, LOCATION, WEEK_MONTH, SOURCE_CALENDAR, RRULE, DURATION) values (DEFAULT, '2016-08-03T20:00:00-04:00', '2016-08-03T21:00:00-04:00', 'ENG CHALK TALK', null, 0, 2, 286, 1, 3, null, null);
insert into COMMON_USER.EVENT (ID, START_DAY, END_DATE, TITLE, DESCRIPTION, ALL_DAY, CALENDAR_ID, LOCATION, WEEK_MONTH, SOURCE_CALENDAR, RRULE, DURATION) values (DEFAULT, '2016-08-03T20:00:00-04:00', '2016-08-03T21:00:00-04:00', 'ENG CHALK TALK', null, 0, 4, 733, 1, 1, null, null);
insert into COMMON_USER.EVENT (ID, START_DAY, END_DATE, TITLE, DESCRIPTION, ALL_DAY, CALENDAR_ID, LOCATION, WEEK_MONTH, SOURCE_CALENDAR, RRULE, DURATION) values (DEFAULT, '2016-08-04T20:00:00-04:00', '2016-08-04T21:00:00-04:00', 'ENG CHALK TALK', null, 1, 5, 352, 1, 1, null, null);
insert into COMMON_USER.EVENT (ID, START_DAY, END_DATE, TITLE, DESCRIPTION, ALL_DAY, CALENDAR_ID, LOCATION, WEEK_MONTH, SOURCE_CALENDAR, RRULE, DURATION) values (DEFAULT, '2016-08-04T08:00:00-04:00', '2016-08-04T08:30:00-04:00', 'LOK Interviews (XO/ENG/EDMC)', null, 1, 3, 581, 1, 2, null, null);

but this is inconsistent with what is returned by curl

Bad

insert into COMMON_USER.EVENT (ID, START_DAY, END_DATE, TITLE, DESCRIPTION, ALL_DAY, CALENDAR_ID, LOCATION, WEEK_MONTH, SOURCE_CALENDAR, RRULE, DURATION) values (DEFAULT, '2016-08-31T21:00:00-04:00', '2016-08-31T21:30:00-04:00', 8, null, 0, 6, 412, 1, 3, null, null);
insert into COMMON_USER.EVENT (ID, START_DAY, END_DATE, TITLE, DESCRIPTION, ALL_DAY, CALENDAR_ID, LOCATION, WEEK_MONTH, SOURCE_CALENDAR, RRULE, DURATION) values (DEFAULT, '2016-08-31T07:00:00-04:00', '2016-08-31T07:15:00-04:00', 9, null, 0, 3, 107, 1, 5, null, null);
insert into COMMON_USER.EVENT (ID, START_DAY, END_DATE, TITLE, DESCRIPTION, ALL_DAY, CALENDAR_ID, LOCATION, WEEK_MONTH, SOURCE_CALENDAR, RRULE, DURATION) values (DEFAULT, '2016-08-31T23:00:00-04:00', '2016-08-31T23:30:00-04:00', 10, null, 0, 1, 471, 1, 4, null, null);
insert into COMMON_USER.EVENT (ID, START_DAY, END_DATE, TITLE, DESCRIPTION, ALL_DAY, CALENDAR_ID, LOCATION, WEEK_MONTH, SOURCE_CALENDAR, RRULE, DURATION) values (DEFAULT, 2016-08-03 20:00:00 -0400, 2016-08-03 21:00:00 -0400, 'ENG CHALK TALK', null, 0, 6, 567, 1, 6, 'FREQUENCY=YEARLY;INTERVAL=237;BYMONTHDAY=27', 5);
insert into COMMON_USER.EVENT (ID, START_DAY, END_DATE, TITLE, DESCRIPTION, ALL_DAY, CALENDAR_ID, LOCATION, WEEK_MONTH, SOURCE_CALENDAR, RRULE, DURATION) values (DEFAULT, 2016-08-03 08:00:00 -0400, 2016-08-03 08:30:00 -0400, 'LOK Interviews (XO/ENG/EDMC)', null, 1, 6, 810, 1, 0, null, null);
insert into COMMON_USER.EVENT (ID, START_DAY, END_DATE, TITLE, DESCRIPTION, ALL_DAY, CALENDAR_ID, LOCATION, WEEK_MONTH, SOURCE_CALENDAR, RRULE, DURATION) values (DEFAULT, 2016-08-03 20:00:00 -0400, 2016-08-03 21:00:00 -0400, 'ENG CHALK TALK', null, 1, 2, 568, 1, 3, null, null);
insert into COMMON_USER.EVENT (ID, START_DAY, END_DATE, TITLE, DESCRIPTION, ALL_DAY, CALENDAR_ID, LOCATION, WEEK_MONTH, SOURCE_CALENDAR, RRULE, DURATION) values (DEFAULT, 2016-08-03 20:00:00 -0400, 2016-08-03 21:00:00 -0400, 'ENG CHALK TALK', null, 0, 2, 183, 1, 6, null, null);
insert into COMMON_USER.EVENT (ID, START_DAY, END_DATE, TITLE, DESCRIPTION, ALL_DAY, CALENDAR_ID, LOCATION, WEEK_MONTH, SOURCE_CALENDAR, RRULE, DURATION) values (DEFAULT, 2016-08-04 20:00:00 -0400, 2016-08-04 21:00:00 -0400, 'ENG CHALK TALK', null, 1, 1, 288, 1, 4, 'FREQUENCY=HOURLY;INTERVAL=216;BYWEEKNO=39,40,24;BYMONTHDAY=19', 2);

the correct format is exhibited in the last 40 or so records but otherwise the data is useless. Curl is being run from a bash file, could there be some sort of load or concurrency issue behind the problem?

Bash File

#!/bin/bash
monthid="c40e3e50"
monthcount=$(($1 * 4 ))
weekid="6a9cfa90"
weekcount=$(($1 * 4 * 4))
dayid="516c8db0"
daycount=$(($1 * 31 * 13))
#monthlink="http://www.mockaroo.com/api/generate.sql/$monthid/download?count=$monthcount&include_header=true&key=2a3b6940" #>> Event.csv
weeklink="https://www.mockaroo.com/$weekid/download?count=$weekcount&include_header=true&key=2a3b6940" #>> Event.csv
daylink="https://www.mockaroo.com/$dayid/download?count=$daycount&include_header=true&key=2a3b6940" # >> Event.csv
#echo $monthlink
#echo $monthcount
echo $weeklink
echo $weekcount
echo $daylink
echo $daycount
#curl $monthlink > 'Event.csv'
curl $daylink > "Event(daily).sql"
curl $weeklink >> "Event(weekly).sql"
echo ""                  > Event.sql
echo "--"               >> Event.sql
echo "-- DAILY --"      >> Event.sql
echo "--"               >> Event.sql
cat "Event(daily).sql"  >> Event.sql
echo ""                 >> Event.sql

echo "--"               >> Event.sql
echo "-- WEEKLY --"     >> Event.sql
echo "--"               >> Event.sql
cat "Event(weekly).sql" >> Event.sql

the actual schema

Event(weekly)
Event(daily)

Here’s some data I downloaded from Event (Weekly) using curl. Does that look right to you?

insert into COMMON_USER.EVENT (ID, START_DAY, END_DATE, TITLE, DESCRIPTION, ALL_DAY, CALENDAR_ID, LOCATION, WEEK_MONTH, SOURCE_CALENDAR, RRULE, DURATION) values (DEFAULT, '2016-08-03T20:00:00-04:00', '2016-08-03T21:00:00-04:00', 'ENG CHALK TALK', null, 1, 6, 93, 1, 3, null, null); insert into COMMON_USER.EVENT (ID, START_DAY, END_DATE, TITLE, DESCRIPTION, ALL_DAY, CALENDAR_ID, LOCATION, WEEK_MONTH, SOURCE_CALENDAR, RRULE, DURATION) values (DEFAULT, '2016-08-03T08:00:00-04:00', '2016-08-03T08:30:00-04:00', 'LOK Interviews (XO/ENG/EDMC)', null, 1, 0, 394, 1, 3, null, null); insert into COMMON_USER.EVENT (ID, START_DAY, END_DATE, TITLE, DESCRIPTION, ALL_DAY, CALENDAR_ID, LOCATION, WEEK_MONTH, SOURCE_CALENDAR, RRULE, DURATION) values (DEFAULT, '2016-08-03T20:00:00-04:00', '2016-08-03T21:00:00-04:00', 'ENG CHALK TALK', null, 0, 3, 620, 1, 5, null, null); insert into COMMON_USER.EVENT (ID, START_DAY, END_DATE, TITLE, DESCRIPTION, ALL_DAY, CALENDAR_ID, LOCATION, WEEK_MONTH, SOURCE_CALENDAR, RRULE, DURATION) values (DEFAULT, '2016-08-03T20:00:00-04:00', '2016-08-03T21:00:00-04:00', 'ENG CHALK TALK', 'nulla sed vel enim sit amet nunc viverra dapibus nulla suscipit ligula in lacus', 0, 5, 842, 1, 2, 'FREQUENCY=HOURLY;INTERVAL=191;BYMONTHDAY=14', 0); insert into COMMON_USER.EVENT (ID, START_DAY, END_DATE, TITLE, DESCRIPTION, ALL_DAY, CALENDAR_ID, LOCATION, WEEK_MONTH, SOURCE_CALENDAR, RRULE, DURATION) values (DEFAULT, '2016-08-04T20:00:00-04:00', '2016-08-04T21:00:00-04:00', 'ENG CHALK TALK', null, 0, 5, 366, 1, 3, null, null);

come to mention it when I run that one alone, it works. Think it might be my script?

curl $weeklink >> "Event(weekly).sql"

should have been

curl $weeklink > "Event(weekly).sql"